[postgis-users] Re: [postgis-devel] Several R-Trees
Mark Cave-Ayland
mark.cave-ayland at ilande.co.uk
Thu Mar 29 09:37:40 PDT 2007
On Thu, 2007-03-29 at 09:06 -0700, Martin Davis wrote:
> Isn't it the case that given a two-table join, the query engine will
> always do a sequential scan of one table and look up values using the
> index of the other table (assuming the optimizer decides to use the
> index in the first place, of course) ?
Not necessarily as it depends on the data types; there are a number of
ways of performing a join across two tables, such as Merge Join and Hash
Join (as well as Nested Loop). In fact, you can use int columns and a
subselect to help bring one side of an (expensive) spatial join outside
of a Nested Loop and into a Merge Join if you know what you are doing.
Note that the geometry overlap operator is not hashable/sortable since
it doesn't represent an equality: see
http://www.postgresql.org/docs/7/static/xoper.htm for more information.
Kind regards,
Mark.
More information about the postgis-users
mailing list