diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-11-28 00:46:19 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-11-28 00:46:19 +0000 |
| commit | 1a95f12702b4e535b5e26ed9c3fcd0b2a1b1a20f (patch) | |
| tree | c56c54fce5968c874b21fb902c1090b486da4719 /src/backend/optimizer/geqo/geqo_eval.c | |
| parent | fe83b975b2bdfa9b553872aa9a5dc959ca89a51f (diff) | |
| download | postgresql-1a95f12702b4e535b5e26ed9c3fcd0b2a1b1a20f.tar.gz | |
Eliminate a lot of list-management overhead within join_search_one_level
by adding a requirement that build_join_rel add new join RelOptInfos to the
appropriate list immediately at creation. Per report from Robert Haas,
the list_concat_unique_ptr() calls that this change eliminates were taking
the lion's share of the runtime in larger join problems. This doesn't do
anything to fix the fundamental combinatorial explosion in large join
problems, but it should push out the threshold of pain a bit further.
Note: because this changes the order in which joinrel lists are built,
it might result in changes in selected plans in cases where different
alternatives have exactly the same costs. There is one example in the
regression tests.
Diffstat (limited to 'src/backend/optimizer/geqo/geqo_eval.c')
| -rw-r--r-- | src/backend/optimizer/geqo/geqo_eval.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/optimizer/geqo/geqo_eval.c b/src/backend/optimizer/geqo/geqo_eval.c index ea74abdde5..1e6428e587 100644 --- a/src/backend/optimizer/geqo/geqo_eval.c +++ b/src/backend/optimizer/geqo/geqo_eval.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/optimizer/geqo/geqo_eval.c,v 1.90 2009/07/19 21:00:43 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/geqo/geqo_eval.c,v 1.91 2009/11/28 00:46:18 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -88,9 +88,12 @@ geqo_eval(PlannerInfo *root, Gene *tour, int num_gene) * is one. We can do this by just temporarily setting the link to NULL. * (If we are dealing with enough join rels, which we very likely are, a * new hash table will get built and used locally.) + * + * join_rel_level[] shouldn't be in use, so just Assert it isn't. */ savelength = list_length(root->join_rel_list); savehash = root->join_rel_hash; + Assert(root->join_rel_level == NULL); root->join_rel_hash = NULL; |
