Re: Making Vars outer-join aware
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>,
"Finnerty,
Jim" <jfinnert@amazon.com>
Date: 2022-08-16T20:57:08Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Re-allow INDEX_VAR as rt_index in ChangeVarNodes().
- fbf80421ead5 16.0 landed
-
Fix thinkos in have_unsafe_outer_join_ref; reduce to Assert check.
- f50f029c497d 16.0 landed
-
Invent "join domains" to replace the below_outer_join hack.
- 3bef56e11650 16.0 landed
-
Do assorted mop-up in the planner.
- b448f1c8d83f 16.0 landed
-
Make Vars be outer-join-aware.
- 2489d76c4906 16.0 landed
-
Invent "multibitmapsets", and use them to speed up antijoin detection.
- e9e26b5e7166 16.0 landed
-
Add basic regression tests for semi/antijoin recognition.
- 0043aa6b8597 16.0 landed
-
Improve performance of adjust_appendrel_attrs_multilevel.
- 2f17b57017e5 16.0 landed
-
Refactor addition of PlaceHolderVars to joinrel targetlists.
- afa0ec30bfd1 16.0 landed
-
Use an explicit state flag to control PlaceHolderInfo creation.
- b3ff6c742f6c 16.0 landed
-
Make PlaceHolderInfo lookup O(1).
- 6569ca43973b 16.0 landed
Attachments
- v2-0001-rearrange-joinrel-PHV-handling.patch (text/x-diff) patch v2-0001
- v2-0002-speed-up-PHI-lookups.patch (text/x-diff) patch v2-0002
I wrote: > ... We can fix > that by adding an index array to go straight from phid to the > PlaceHolderInfo. While thinking about where to construct such > an index array, I decided it'd be a good idea to have an explicit > step to "freeze" the set of PlaceHolderInfos, at the start of > deconstruct_jointree. On further thought, it seems better to maintain the index array from the start, allowing complete replacement of the linear list searches. We can add a separate bool flag to denote frozen-ness. This does have minor downsides: * Some fiddly code is needed to enlarge the index array at need. But it's not different from that for, say, simple_rel_array. * If we ever have a need to mutate the placeholder_list as a whole, we'd have to reconstruct the index array to point to the new objects. We don't do that at present, except in one place in analyzejoins.c, which is easily fixed. While the same argument could be raised against the v1 patch, it's not very likely that we'd be doing such mutation beyond the start of deconstruct_jointree. Hence, see v2 attached. regards, tom lane