Re: Index usage for elem-contained-by-const-range clauses

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, Pritam Baral <pritam(at)pritambaral(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Index usage for elem-contained-by-const-range clauses
Date: 2017-03-11 20:28:00
Message-ID: 3f5619f9-d52c-6380-6489-7f96006a339b@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2017-03-11 20:35:38 Re: scram and \password
Previous Message Kevin Grittner 2017-03-11 20:24:29 Re: [GSOC 17] Eliminate O(N^2) scaling from rw-conflict tracking in serializable transactions