pgsql: Rearrange make_partitionedrel_pruneinfo to avoid work when we ca

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Rearrange make_partitionedrel_pruneinfo to avoid work when we ca
Date: 2019-03-22 18:56:26
Message-ID: E1h7PL8-0002n3-2t@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Rearrange make_partitionedrel_pruneinfo to avoid work when we can't prune.

Postpone most of the effort of constructing PartitionedRelPruneInfos
until after we have found out whether run-time pruning is needed at all.
This costs very little duplicated effort (basically just an extra
find_base_rel() call per partition) and saves quite a bit when we
can't do run-time pruning.

Also, merge the first loop (for building relid_subpart_map) into
the second loop, since we don't need the map to be valid during
that loop.

Amit Langote

Discussion: https://postgr.es/m/9d7c5112-cb99-6a47-d3be-cf1ee6862a1d@lab.ntt.co.jp

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/734308a220729e4ececa3758bdcae39a335d55ea

Modified Files
--------------
src/backend/partitioning/partprune.c | 108 ++++++++++++++++++++++-------------
1 file changed, 68 insertions(+), 40 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-03-22 19:19:38 Re: pgsql: Collations with nondeterministic comparison
Previous Message Peter Geoghegan 2019-03-22 18:37:00 pgsql: Go back to suppressing foreign_data DETAIL test output.