Re: [HACKERS] path toward faster partition pruning

From: Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Beena Emerson <memissemerson(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] path toward faster partition pruning
Date: 2018-01-05 18:04:08
Message-ID: 8d9dd2e8-b991-40bf-d1ef-c36cee1c4e41@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi David,

On 01/04/2018 09:21 PM, David Rowley wrote:
> On 5 January 2018 at 07:16, Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com> wrote:
>> Could you share your thoughts on
>>
>> 1) if the generic plan mechanics should know about the pruning and hence
>> give a lower planner cost
>
> I think the problem here is that cached_plan_cost() is costing the
> planning cost of the query too low. If this was costed higher then its
> more likely the generic plan would have been chosen, instead of
> generating a custom plan each time.
>
> How well does it perform if you change cpu_operator_cost = 0.01?
>

It gives 38.82 for generic_cost, and 108.82 for avg_custom_cost on
master (8249 TPS). And, 38.82 for generic_cost, and 79.705 for
avg_custom_cost with v17 (7891 TPS). Non-partitioned is 11722 TPS.

> I think cached_plan_cost() does need an overhaul, but I think it's not
> anything that should be done as part of this patch. You've picked HASH
> partitioning here just because the current master does not perform any
> partition pruning for that partitioning strategy.
>

Well, I mainly picked HASH because that is my use-case :)

For a range based setup it gives 39.84 for generic_cost, and 89.705 for
avg_custom_cost (7862 TPS).

Best regards,
Jesper

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Beena Emerson 2018-01-05 18:31:45 Re: [HACKERS] Runtime Partition Pruning
Previous Message Alvaro Herrera 2018-01-05 17:56:27 Re: pgsql: Implement channel binding tls-server-end-point for SCRAM