Do you understand
how to use a hash in Perl? They aren't exactly like databases (although the underlying idea is essentially the same). In any case there are no query/select statements in the SQL sense.
I'm not a database guy, so I don't know the voodoo to set up your data model optimally for a database, but when I look at your problem, I see a hash mapping boat identifiers (names probably) to arrays of coordinate pairs in chronological order (HoAoA).
But then I think that that kind of structure maps perfectly to
netcdf, on which I cut my teeth. So I'm probably horribly biased on this.
As for optimization,
super search,
profiling, and maybe
low-level formats (for numeric data) are your friends.