Re: why partition pruning doesn't work? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: why partition pruning doesn't work?
Date
Msg-id 556.1528727192@sss.pgh.pa.us
Whole thread Raw
In response to Re: why partition pruning doesn't work?  (David Rowley <david.rowley@2ndquadrant.com>)
Responses Re: why partition pruning doesn't work?
List pgsql-hackers
David Rowley <david.rowley@2ndquadrant.com> writes:
> On 11 June 2018 at 10:49, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> * The business with ExecFindInitialMatchingSubPlans remapping the
>> subplan indexes seems very dubious to me.  Surely, that is adding
>> way more complexity and fragility than it's worth.

> I think having the ability to prune during executor initialisation is
> enormously important. I think without it, this patch is less than half
> as useful.

Sure.

> However, if you didn't mean removing the executor
> initialise pruning, and just not remapping the arrays, then I'm not
> sure how we'd do that.  I'd previously tried having NULL subnodes in
> the Append and I thought it required too much hacking work in
> explain.c, so I decided to just collapse the array instead and do what
> was required to make it work after having removed the unneeded
> subplans. Did you have another idea on how to do this?

No, that was pretty much exactly what I was envisioning.  I have
not looked at the consequences for explain.c but it seemed like
it couldn't be all that bad; and to my mind the remapping business
in the partition code is pretty bad.  "It's all in one file" is not
a suitable justification for unintelligible, overcomplex code.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Spilling hashed SetOps and aggregates to disk
Next
From: "Jonathan S. Katz"
Date:
Subject: PostgreSQL 11 Beta 2 Release: 2018-06-28