pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't constraint-exclude partitioned tables as much
Date: Tue, 13 Aug 2019 15:22:04 +0000
Message-ID: <E1hxYce-0006MY-Nk@gemulon.postgresql.org> (raw)

Don't constraint-exclude partitioned tables as much

We only need to invoke constraint exclusion on partitioned tables when
they are a partition, and they themselves contain a default partition;
it's not necessary otherwise, and it's expensive, so avoid it.  Also, we
were trying once for each clause separately, but we can do it for all
the clauses at once.

While at it, centralize setting of RelOptInfo->partition_qual instead of
computing it in slightly different ways in different places.

Per complaints from Simon Riggs about 4e85642d935e; reviewed by Yuzuko
Hosoya, Kyotaro Horiguchi.

Author: Amit Langote.  I (Álvaro) again mangled the patch somewhat.
Discussion: https://postgr.es/m/CANP8+j+tMCY=nEcQeqQam85=uopLBtX-2vHiLD2bbp7iQQUKpA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/815ef2f568c754dcb539cca574f1982317d74db6

Modified Files
--------------
src/backend/optimizer/util/plancat.c | 59 ++++++++++++++++++++----------
src/backend/partitioning/partprune.c | 71 +++++++++++++-----------------------
2 files changed, 65 insertions(+), 65 deletions(-)



Message-ID: <E1hxYce-0006MY-Nk@gemulon.postgresql.org>
Permalink:  ../E1hxYce-0006MY-Nk@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hxYce-0006MY-Nk@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: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Don't constraint-exclude partitioned tables as much
  In-Reply-To: <E1hxYce-0006MY-Nk@gemulon.postgresql.org>
  References: <E1hxYce-0006MY-Nk@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