RE: speeding up planning with partitions

From: "Imai, Yoshikazu" <imai(dot)yoshikazu(at)jp(dot)fujitsu(dot)com>
To: 'Amit Langote' <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
Cc: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: speeding up planning with partitions
Date: 2019-01-21 00:51:53
Message-ID: 0F97FA9ABBDBE54F91744A9B37151A5125964E@g01jpexmbkw24
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tsunakawa-san

On Thu, Jan 18, 2019 at 5:29 AM, Amit Langote wrote:
> On 2019/01/18 14:12, Tsunakawa, Takayuki wrote:
...
> > Isn't CheckCachedPlan() (and AcquireExecutorLocks() therein) called
> in every EXECUTE after 6th one due to some unknow issue?
>
> CheckCachedPlan is only called if choose_custom_plan() returns false
> resulting in generic plan being created/reused. With plan_cache_mode
> = auto, I see it always returns true, because a custom plan containing
> a single partition to scan is way cheaper than the generic plan.
>
> > Does choose_custom_plan() always return true after 6th EXECUTE?
>
> Yes.

Yes.
I also checked choose_custom_plan() always returns true excluding 6th EXECUTE
and CheckCachedPlan() is only called at 6th EXECUTE.

Yoshikazu Imai

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chapman Flack 2019-01-21 01:04:56 Re: Allowing extensions to find out the OIDs of their member objects
Previous Message Andrew Gierth 2019-01-21 00:49:13 Re: Allowing extensions to find out the OIDs of their member objects