pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Delay lock acquisition for partitions until we route a tuple to
Date: Thu, 21 Feb 2019 16:33:15 +0000
Message-ID: <E1gwrHf-0006wa-K0@gemulon.postgresql.org> (raw)

Delay lock acquisition for partitions until we route a tuple to them.

Instead of locking all partitions to which we might route a tuple at
executor startup, just lock them as we use them.  In some cases such a
partition might get locked at executor startup anyway because it
appears in the query's range table for some other reason, but in other
cases this is a bit savings.

This changes the order in which partitions are locked in some cases,
which might conceivably create deadlock hazards that don't exist
today, but per discussion, it seems like such cases should be rare
enough that we can neglect them in favor of improving performance.

David Rowley, reviewed and tested by Tomas Vondra, Sho Kato, John
Naylor, Tom Lane, and me.

Discussion: http://postgr.es/m/CAKJS1f-=FnMqmQP6qitkD+xEddxw22ySLP-0xFk3JAqUX2yfMw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9eefba181f7782d27d85d7e94e6028371e7ab2d7

Modified Files
--------------
src/backend/executor/execPartition.c | 35 ++++++++++++++++-------------------
1 file changed, 16 insertions(+), 19 deletions(-)



Message-ID: <E1gwrHf-0006wa-K0@gemulon.postgresql.org>
Permalink:  ../E1gwrHf-0006wa-K0@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gwrHf-0006wa-K0@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: Delay lock acquisition for partitions until we route a tuple to
  In-Reply-To: <E1gwrHf-0006wa-K0@gemulon.postgresql.org>
  References: <E1gwrHf-0006wa-K0@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox