[RFC] [PATCH] Flexible "partition pruning" hook

From: Mike Palmiotto <mike(dot)palmiotto(at)crunchydata(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: [RFC] [PATCH] Flexible "partition pruning" hook
Date: 2019-02-25 21:22:17
Message-ID: CAMN686HzMrb5oPJN4hTqFYE1+3BJb3k__Ks+-q0c-q3k_wVveA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings,

Attached is a patch which attempts to solve a few problems:

1) Filtering out partitions flexibly based on the results of an
external function call (supplied by an extension).
2) Filtering out partitions from pg_inherits based on the same function call.
3) Filtering out partitions from a partitioned table BEFORE the partition
is actually opened on-disk.

The name "partitionChildAccess_hook" comes from the fact that the
backend may not have access to a particular partition within the
partitioned table. The idea would be to silently filter out the
partition from queries to the parent table, which means also adjusting
the returned contents of find_inheritance_children based on the
external function.

I am curious how the community feels about these patches and if there
is an alternative approach to solve the above issues (perhaps
another existing hook).

Thanks for your time.

--
Mike Palmiotto
Software Engineer
Crunchy Data Solutions
https://crunchydata.com

Attachment Content-Type Size
flexible-partition-pruning.patch text/x-patch 2.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-02-25 21:31:31 Re: POC: converting Lists into arrays
Previous Message Peter Geoghegan 2019-02-25 21:21:30 Re: POC: converting Lists into arrays