Re: why partition pruning doesn't work?

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: why partition pruning doesn't work?
Date: 2018-06-06 09:52:04
Message-ID: CAKJS1f_jatg5+qbrha2fGog63t3VdbNnOkYZitJtx-uo5H5EsQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 6 June 2018 at 18:05, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> On 2018/06/06 14:10, David Rowley wrote:
>> I then decided that
>> I didn't like the way we need to check which params are in the Expr
>> each time we call partkey_datum_from_expr. It seems better to prepare
>> this in advance when building the pruning steps. I started work on
>> that, but soon realised that I'd need to pass a List of Bitmapsets to
>> the executor. This is a problem as Bitmapset is not a Node type and
>> cannot be copied with COPY_NODE_FIELD(). Probably this could be
>> refactored to instead of passing 3 Lists in the PartitionPruneStepOp
>> we could invent a new node type that just has 3 fields and store a
>> single List.
>
> I wonder why we need to create those Bitmapsets in the planner? Why not
> in ExecSetupPartitionPruneState()? For example, like how
> context->exprstates is initialized.

That seems like a good idea. Certainly much better than working them
out each time we prune.

v3 patch attached.

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

Attachment Content-Type Size
run-time_pruning_for_exprs_v3.patch application/octet-stream 22.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergey Cherkashin 2018-06-06 10:06:14 processSQLNamePattern() analog
Previous Message Konstantin Knizhnik 2018-06-06 09:37:57 Re: libpq compression