Jeff Hoffmann <[EMAIL PROTECTED]> writes:
> Tom Lane wrote:
>> There is already support for r-tree indexes, but as far as I know the
>> '@' operator is not connected up to indexes.
> i'm just throwing this out without testing it, but i think something
> like this might work: coerce both the point and polygon into boxes (i
> think box(polygon) gives you the bounding box, at least) and use the
> overlap (&&) operator, which works fine with r-tree indexes on two
> boxes, then use the contained operator (@) on what you get from that.
Right, that's pretty much exactly what index support for @ would do for
you under-the-hood. I wouldn't expect the index to give you an answer
finer-grained than bounding boxes, so you'd still need to run @ itself
on the candidates found by the indexable query.
Jeff has a good point that doing the transformation by hand might be
an acceptable answer for the time being. You can hack a lot of queries
in the time it will take to teach the system to do that same
transformation ...
regards, tom lane