Re: Delay locking partitions during query execution - Mailing list pgsql-hackers

From David Rowley
Subject Re: Delay locking partitions during query execution
Date
Msg-id CAKJS1f_7hr6NJiQK+V-X0=pZnsnxDqZpE15BNKFj1Qoj1ybqOg@mail.gmail.com
Whole thread Raw
In response to Re: Delay locking partitions during query execution  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: Delay locking partitions during query execution  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
On Mon, 28 Jan 2019 at 20:45, Amit Langote
<Langote_Amit_f8@lab.ntt.co.jp> wrote:
> It seems to me that plancache.c doesn't really need to perform
> AcquireExecutorLocks()/LockRelationOid() to learn that a partition's
> reloptions property has changed to discard a generic plan and build a new
> one.  AFAICT, PlanCacheRelCallback() takes care of resetting a cached plan
> by observing that an invalidation message that it received  either from
> the same session or from another session belongs to one of the relations
> in PlannedStmt.relationOids.  That list must already contain all
> partitions' OIDs.

Really? So when you tried my case you properly got a plan with a
non-parallel Seq Scan on listp1?

I imagine you didn't with yours since we check for relcache
invalidations at the start of a transaction.  I performed both my
EXECUTEs in the same transaction.


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


pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: WIP: Avoid creation of the free space map for small tables
Next
From: David Rowley
Date:
Subject: Re: "SELECT ... FROM DUAL" is not quite as silly as it appears