Re: Delay locking partitions during INSERT and UPDATE - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Delay locking partitions during INSERT and UPDATE
Date
Msg-id 10459.1550531700@sss.pgh.pa.us
Whole thread Raw
In response to Re: Delay locking partitions during INSERT and UPDATE  (David Rowley <david.rowley@2ndquadrant.com>)
Responses Re: Delay locking partitions during INSERT and UPDATE  (David Rowley <david.rowley@2ndquadrant.com>)
Re: Delay locking partitions during INSERT and UPDATE  (David Rowley <david.rowley@2ndquadrant.com>)
Re: Delay locking partitions during INSERT and UPDATE  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
David Rowley <david.rowley@2ndquadrant.com> writes:
> On Tue, 19 Feb 2019 at 11:47, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Are we talking about the same patch?  The one I'm looking at seems
>> to be mostly planner and plancache changes:

> Looks like you're looking at the patch from the "Delay locking
> partitions during query execution" thread [1].  Different thing
> altogether, although the names are confusingly similar.

My apologies --- I searched my inbox for "Delay locking partitions",
and failed to notice that I was extracting a patch from the wrong
thread with that in its title.   (The questions I posed should
be posted to that thread instead, as they still apply there.)

Now that I've looked at *this* thread's patch, I agree that having
the executor acquire locks based on find_all_inheritors() is a
pretty horrid idea.  However, it still seems like this is being
done in a vacuum without attention to locks already acquired
upstream.  How much does the knowledge that the planner or plancache
would've already locked everything mentioned in the rangetable
affect the issues here?

I'm inclined to think that if we already have lock on the parent
partitioned table (thereby, IIUC, guaranteeing that its partitioning
info can't change) that the order in which we acquire the same lock
level on its partition(s) isn't very important.

            regards, tom lane


pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Inadequate executor locking of indexes
Next
From: Andrew Dunstan
Date:
Subject: Re: 2019-03 CF Summary / Review - Tranche #2