pgsql: Rework code to determine partition pruning procedure - Mailing list pgsql-committers

From Alvaro Herrera
Subject pgsql: Rework code to determine partition pruning procedure
Date
Msg-id E1f9B7O-0006wC-78@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Rework code to determine partition pruning procedure

Amit Langote reported that partition prune was unable to work with
arrays, enums, etc, which led him to research the appropriate way to
match query clauses to partition keys: instead of searching for an exact
match of the expression's type, it is better to rely on the fact that
the expression qual has already been resolved to a specific operator,
and that the partition key is linked to a specific operator family.
With that info, it's possible to figure out the strategy and comparison
function to use for the pruning clause in a manner that works reliably
for pseudo-types also.

Include new test cases that demonstrate pruning where pseudotypes are
involved.

Author: Amit Langote, Álvaro Herrera
Discussion: https://postgr.es/m/2b02f1e9-9812-9c41-972d-517bdc0f815d@lab.ntt.co.jp

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e5dcbb88a15d445e0ccb3db3194f4a122b792df6

Modified Files
--------------
src/backend/partitioning/partprune.c          | 110 ++++++++++----------
src/test/regress/expected/partition_prune.out | 138 ++++++++++++++++++++++++++
src/test/regress/sql/partition_prune.sql      |  53 ++++++++++
3 files changed, 251 insertions(+), 50 deletions(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: pgsql: Enlarge find_other_exec's meager fgets buffer
Next
From: Alvaro Herrera
Date:
Subject: pgsql: Plural of modulus is moduli