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

2019-07-12 Thread Mike Palmiotto
On Fri, Jul 12, 2019 at 4:25 AM Amit Langote wrote: > > Sorry for jumping into this thread pretty late. I have read the > messages on this thread a couple of times and... > > On Fri, Jul 12, 2019 at 3:05 PM Kyotaro Horiguchi > wrote: > > I'm on Peter's side. Unlike other similar hooks, this hook

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

2019-07-12 Thread Amit Langote
Sorry for jumping into this thread pretty late. I have read the messages on this thread a couple of times and... On Fri, Jul 12, 2019 at 3:05 PM Kyotaro Horiguchi wrote: > I'm on Peter's side. Unlike other similar hooks, this hook is > provided just to introduce arbitrary inconsistency in partit

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

2019-07-11 Thread Kyotaro Horiguchi
Hello. I'm on Peter's side. Unlike other similar hooks, this hook is provided just to introduce arbitrary inconsistency in partition pruning. # By the way, InvokePartitionPruningHook seems useless if the # reason for it is to avoid duplicate if()'s . Adding check constraint on children works as

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

2019-07-11 Thread Mike Palmiotto
On Thu, Jul 11, 2019 at 8:49 AM Thomas Munro wrote: > > > Here are some comments on superficial aspects of the patch: > > +/* Custom partition child access hook. Provides further partition pruning > given > + * child OID. > + */ > > Should be like: > > /* > * Multi-line comment... > */ Fixed

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

2019-07-11 Thread Thomas Munro
On Tue, Jul 9, 2019 at 3:31 PM Mike Palmiotto wrote: > Attached you will find a patch (rebased on master) that passes all > tests on my local CentOS 7 box. Thanks again for the catch! Hi Mike, Here are some comments on superficial aspects of the patch: +/* Custom partition child access hook. Pr

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

2019-07-08 Thread Mike Palmiotto
On Mon, Jul 8, 2019 at 10:59 AM Mike Palmiotto wrote: > > On Sun, Jul 7, 2019 at 9:46 PM Thomas Munro wrote: >> >> On Sat, Apr 6, 2019 at 3:06 PM Andres Freund wrote: >> > I've moved this to the next CF, and marked it as targeting v13. >> >> Hi Mike, >> >> Commifest 1 for PostgreSQL 13 is here.

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

2019-07-08 Thread Mike Palmiotto
On Sun, Jul 7, 2019 at 9:46 PM Thomas Munro wrote: > On Sat, Apr 6, 2019 at 3:06 PM Andres Freund wrote: > > I've moved this to the next CF, and marked it as targeting v13. > > Hi Mike, > > Commifest 1 for PostgreSQL 13 is here. I was just going through the > automated build results for the 'fe

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

2019-07-07 Thread Thomas Munro
On Sat, Apr 6, 2019 at 3:06 PM Andres Freund wrote: > I've moved this to the next CF, and marked it as targeting v13. Hi Mike, Commifest 1 for PostgreSQL 13 is here. I was just going through the automated build results for the 'fest and noticed that your patch causes a segfault in the regressio

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

2019-04-05 Thread Andres Freund
Hi, On 2019-02-28 13:36:32 -0500, Mike Palmiotto wrote: > On Wed, Feb 27, 2019 at 12:36 PM Peter Eisentraut > wrote: > > > > To rephrase this: You have a partitioned table, and you have a RLS > > policy that hides certain rows, and you know based on your business > > logic that under certain cir

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

2019-03-20 Thread David Steele
Hi Peter, On 2/28/19 10:36 PM, Mike Palmiotto wrote: On Wed, Feb 27, 2019 at 12:36 PM Peter Eisentraut wrote: To rephrase this: You have a partitioned table, and you have a RLS policy that hides certain rows, and you know based on your business logic that under certain circumstances entire pa

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

2019-02-28 Thread Mike Palmiotto
On Wed, Feb 27, 2019 at 12:36 PM Peter Eisentraut wrote: > > To rephrase this: You have a partitioned table, and you have a RLS > policy that hides certain rows, and you know based on your business > logic that under certain circumstances entire partitions will be hidden, > so they don't need to

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

2019-02-27 Thread Peter Eisentraut
On 2019-02-26 19:06, Mike Palmiotto wrote: > The desired effect would be to have `SELECT * from test.partpar;` > return check only the partitions where username can see any row in the > table based on column b. This is applicable, for instance, when a > partition of test.partpar (say test.partpar_b

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

2019-02-27 Thread Mike Palmiotto
On Tue, Feb 26, 2019 at 1:06 PM Mike Palmiotto wrote: > > On Tue, Feb 26, 2019 at 1:55 AM Tsunakawa, Takayuki > wrote: > > > > From: Mike Palmiotto [mailto:mike.palmio...@crunchydata.com] > > > Attached is a patch which attempts to solve a few problems: Updated patch attached. > > > > > What c

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

2019-02-26 Thread Mike Palmiotto
On Tue, Feb 26, 2019 at 1:55 AM Tsunakawa, Takayuki wrote: > > From: Mike Palmiotto [mailto:mike.palmio...@crunchydata.com] > > 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 b

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

2019-02-25 Thread Michael Paquier
On Tue, Feb 26, 2019 at 06:55:30AM +, Tsunakawa, Takayuki wrote: > What concrete problems would you expect this patch to solve? What > kind of extensions do you imagine? I'd like to hear about the > examples. For example, "PostgreSQL 12 will not be able to filter > out enough partitions when

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

2019-02-25 Thread Tsunakawa, Takayuki
From: Mike Palmiotto [mailto:mike.palmio...@crunchydata.com] > 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 o

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

2019-02-25 Thread Mike Palmiotto
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