Re: [HACKERS] Runtime Partition Pruning

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, Beena Emerson <memissemerson(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, amul sul <sulamul(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Subject: Re: [HACKERS] Runtime Partition Pruning
Date: 2018-04-04 02:31:17
Message-ID: CAKJS1f89iTbmxb+Lav4a8Mt5QZ15iv4sqc2GDH2umJs+RbSXpA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 4 April 2018 at 14:10, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com> wrote:
> On 4 April 2018 at 05:44, Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com> wrote:
>> The attached case doesn't trigger a generic plan, so basically all time is
>> spent in GetCachedPlan.
>
> Yeah, there's still no resolution to the fact that a generic plan +
> runtime pruning might be cheaper than a custom plan. The problem is
> the generic plan appears expensive to the custom vs generic plan
> comparison due to it containing more Append subnodes and the run-time
> pruning not being taking into account by that comparison.

Just for the record, some of the benchmarks I did above also used the
attached patch for the -M prepared case.

I didn't intend the patch for PostgreSQL, but I am starting to think
that it would be useful to have something to save from having to
EXECUTE PREPAREd statements 5 times before getting a generic plan.
Doing that is starting to seem a bit fragile to me. Would be nice to
have some solution, but I've so far not thought of anything better
than the attached (incomplete) patch.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
0001-Add-force_generic_plan-GUC.patch application/octet-stream 3.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2018-04-04 02:40:16 Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS
Previous Message Peter Eisentraut 2018-04-04 02:31:14 Re: [PATCH] Logical decoding of TRUNCATE