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

From Pritam Baral
Subject [HACKERS] Index usage for elem-contained-by-const-range clauses
Date
Msg-id 1b86eaf1-273f-b8cd-6e9e-5d0bfcb7abb7@pritambaral.com
Whole thread Raw
Responses Re: [HACKERS] Index usage for elem-contained-by-const-range clauses  (Robert Haas <robertmhaas@gmail.com>)
Re: [HACKERS] Index usage for elem-contained-by-const-range clauses  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Re: [HACKERS] Index usage for elem-contained-by-const-range clauses  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
The topic has been previously discussed[0] on the -performance mailing list,
about four years ago.

In that thread, Tom suggested[0] the planner could be made to "expand
"intcol <@
'x,y'::int4range" into "intcol between x and y", using something similar
to the
index LIKE optimization (ie, the "special operator" stuff in indxpath.c)".

This patch tries to do exactly that. It's not tied to any specific datatype,
and has been tested with both builtin types and custom range types. Most
of the
checking for proper datatypes, operators, and btree index happens before
this
code, so I haven't run into any issues yet in my testing. But I'm not
familiar
enough with the internals to be able to confidently say it can handle
all cases
just yet.

[0]:
https://www.postgresql.org/message-id/flat/9860.1364013108%40sss.pgh.pa.us#9860.1364013108@sss.pgh.pa.us

-- 
#!/usr/bin/env regards
Chhatoi Pritam Baral

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Corey Huinker
Date:
Subject: Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless)
Next
From: Jim Nasby
Date:
Subject: Re: [HACKERS] Change in "policy" on dump ordering?