|From:||Kim Johan Andersson <kimjand(at)kimmet(dot)dk>|
|Subject:||[PATCH] Add support function for containment operators|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
I had noticed that performance wasn't great when using the @> or <@
operators when examining if an element is contained in a range.
Based on the discussion in  I would like to suggest the following
This patch attempts to improve the row estimation, as well as opening
the possibility of using a btree index scan when using the containment
This is done via a new support function handling the following 2 requests:
find_index_quals will build an operator clause, given at least one
find_simplified_clause will rewrite the containment operator into a
clause using inequality operators from the btree family (if available
for the element type).
A boolean constant is returned if the range is either empty or has no
Performing the rewrite here lets the clausesel machinery provide the
same estimates as for normal scalar inequalities.
In both cases build_bound_expr is used to build the operator clauses
Thanks to Laurenz Albe for giving the patch a look before submission.
Kim Johan Andersson
|Next Message||Anton Kirilov||2023-04-29 16:06:03||Re: Add PQsendSyncMessage() to libpq|
|Previous Message||John Naylor||2023-04-29 08:17:35||Re: Overhauling "Routine Vacuuming" docs, particularly its handling of freezing|