Re: [HACKERS] Index usage for elem-contained-by-const-range clauses - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: [HACKERS] Index usage for elem-contained-by-const-range clauses
Date
Msg-id 3f5619f9-d52c-6380-6489-7f96006a339b@BlueTreble.com
Whole thread Raw
In response to Re: [HACKERS] Index usage for elem-contained-by-const-range clauses  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Responses Re: [HACKERS] Index usage for elem-contained-by-const-range clauses  (Pritam Baral <pritam@pritambaral.com>)
List pgsql-hackers
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)



pgsql-hackers by date:

Previous
From: Kevin Grittner
Date:
Subject: [HACKERS] Re: [GSOC 17] Eliminate O(N^2) scaling from rw-conflict tracking inserializable transactions
Next
From: Joe Conway
Date:
Subject: Re: [HACKERS] scram and \password