From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Speed up match_eclasses_to_foreign_key_col() when there are many
Date: Thu, 21 Feb 2019 01:53:25 +0000
Message-ID: <E1gwdYD-0006Gd-MJ@gemulon.postgresql.org> (raw)
Speed up match_eclasses_to_foreign_key_col() when there are many ECs.
Check ec_relids before bothering to iterate through the EC members.
On a perhaps extreme, but still real-world, query in which
match_eclasses_to_foreign_key_col() accounts for the bulk of the
planner's runtime, this saves nearly 40% of the runtime. It's a bit
of a stopgap fix, but it's simple enough to be back-patched to 9.6
where this code came in; so let's do that.
David Rowley
Discussion: https://postgr.es/m/6970.1545327857@sss.pgh.pa.us
Branch
------
REL9_6_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/09c9dd39efeae4820b2f6343a5caf4d527bf1603
Modified Files
--------------
src/backend/optimizer/path/equivclass.c | 8 ++++++++
1 file changed, 8 insertions(+)
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: Speed up match_eclasses_to_foreign_key_col() when there are many
In-Reply-To: <E1gwdYD-0006Gd-MJ@gemulon.postgresql.org>
References: <E1gwdYD-0006Gd-MJ@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