Patch: add GiST support for BOX @> POINT queries

Andrew Tipton <andrew.t.tipton@gmail.com>

From: Andrew Tipton <andrew.t.tipton@gmail.com>
To: pgsql-hackers@postgresql.org
Date: 2011-02-23T23:05:40Z
Lists: pgsql-hackers

Attachments

While playing around with the BOX and POINT datatypes, I was surprised to
note that BOX @> POINT (and likewise POINT <@ BOX) queries were not using
the GiST index I had created on the BOX column.  The attached patch adds a
new strategy @>(BOX,POINT) to the box_ops opclass.  Internally,
gist_box_consistent simply transforms the POINT into its corresponding BOX.

This is my first Postgres patch, and I wasn't able to figure out how to go
about creating a regression test for this change.  (All existing tests do
pass, but none of them seem to specifically test index behaviour.)

I know it is quite late in the CommitFest, should I add this to CF-Next?

-Andrew