Eliminate a lot of list-management overhead within join_search_one_level

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 1a95f12702b4e535b5e26ed9c3fcd0b2a1b1a20f
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2009-11-28T00:46:19Z
Releases: 9.0.0
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.

Files