Re: [HACKERS] path toward faster partition pruning

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Beena Emerson <memissemerson(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] path toward faster partition pruning
Date: 2018-02-15 05:57:38
Message-ID: 520f8a71-286d-e36d-34cf-363fd74366e1@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018/02/13 20:08, Amit Langote wrote:
> On 2018/02/09 21:36, Amit Langote wrote:
>> 0004-Faster-partition-pruning.patch
>>
>> The main patch that adds src/backend/optimizer/util/partprune.c, a module
>> to provide the functionality that will replace the current approach of
>> calling relation_excluded_by_constraints() for each partition.
>>
>> Sorry, but there is still this big TODO here, which I'll try to fix early
>> next week.
>>
>> + * partprune.c
>> + * Provides functions to prune partitions of a partitioned table by
>> + * comparing provided set of clauses with the table's partitions'
>> + * boundaries
>> + *
>> + * TODO: write a longer description of things in this file
>
> And I tried to fix that to some degree in the attached updated version.

Here is an updated version.

I realized that 0005 (Add only unpruned partitioned child rels to
partitioned_rels) did that only for (Merge)Append. That is, it didn't
handle ModifyTable. I fixed that by teaching inheritance_planner() to do
it. In the process, I found out that we don't need the
PartitionedChildRelInfo node and related code anymore, so the patch ended
up removing more code than adding it.

Thanks,
Amit

Attachment Content-Type Size
v27-0001-Modify-bound-comparision-functions-to-accept-mem.patch text/plain 6.5 KB
v27-0002-Refactor-partition-bound-search-functions.patch text/plain 8.3 KB
v27-0003-Add-parttypid-partcollation-partsupfunc-to-Parti.patch text/plain 5.2 KB
v27-0004-Faster-partition-pruning.patch text/plain 106.7 KB
v27-0005-Add-only-unpruned-partitioned-child-rels-to-part.patch text/plain 24.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2018-02-15 06:28:39 Re: autovacuum: change priority of the vacuumed tables
Previous Message henry@visionlink.org 2018-02-15 02:59:35 Re: Cached/global query plans, autopreparation