On 3/10/17 8:29 AM, Alexander Korotkov wrote:
That's cool idea. But I would say more. Sometimes it's useful to transform "intcol between x and y" into "intcol <@ 'x,y'::int4range". btree_gin supports "intcol between x and y" as overlap of "intcol >= x" and "intcol <= y". That is very inefficient. But it this clause would be transformed into "intcol <@ 'x,y'::int4range", btree_gin could handle this very efficient.
That's certainly be nice as well, but IMHO it's outside the scope of this patch to accomplish that.
BTW, while we're wishing for things... Something else that would be nice is if there was a way to do these kind of transforms without hacking the backend...
Also, I noticed that patch haven't regression tests.
BTW, those tests need to pay special attention to inclusive vs exclusive bounds.
-- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com 855-TREBLE2 (855-873-2532) -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers