pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't copy PartitionBoundInfo in set_relation_partition_info.
Date: Fri, 22 Mar 2019 18:17:17 +0000
Message-ID: <E1h7OjF-0001qU-L8@gemulon.postgresql.org> (raw)

Don't copy PartitionBoundInfo in set_relation_partition_info.

I (tgl) remain dubious that it's a good idea for PartitionDirectory
to hold a pin on a relcache entry throughout planning, rather than
copying the data or using some kind of refcount scheme.  However, it's
certainly the responsibility of the PartitionDirectory code to ensure
that what it's handing back is a stable data structure, not that of
its caller.  So this is a pretty clear oversight in commit 898e5e329,
and one that can cost a lot of performance when there are many
partitions.

Amit Langote (extracted from a much larger patch set)

Discussion: https://postgr.es/m/CA+TgmoY3bRmGB6-DUnoVy5fJoreiBJ43rwMrQRCdPXuKt4Ykaw@mail.gmail.com
Discussion: https://postgr.es/m/9d7c5112-cb99-6a47-d3be-cf1ee6862a1d@lab.ntt.co.jp

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c8151e642368599dc77c4448e6bdc34cc8810475

Modified Files
--------------
src/backend/optimizer/util/plancat.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)



Message-ID: <E1h7OjF-0001qU-L8@gemulon.postgresql.org>
Permalink:  ../E1h7OjF-0001qU-L8@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1h7OjF-0001qU-L8@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Don't copy PartitionBoundInfo in set_relation_partition_info.
  In-Reply-To: <E1h7OjF-0001qU-L8@gemulon.postgresql.org>
  References: <E1h7OjF-0001qU-L8@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