pgsql: Speed up match_eclasses_to_foreign_key_col() when there aremany - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Speed up match_eclasses_to_foreign_key_col() when there aremany
Date
Msg-id [email protected]
Whole thread Raw
List pgsql-committers
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/[email protected]

Branch
------
master

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

Modified Files
--------------
src/backend/optimizer/path/equivclass.c | 8 ++++++++
1 file changed, 8 insertions(+)


pgsql-committers by date:

Previous
From: Andrew Gierth
Date:
Subject: pgsql: Use an unsigned char for bool if we don't use the native bool.
Next
From: Peter Eisentraut
Date:
Subject: pgsql: Fix dbtoepub output file name