Commit b5415e3
committed
Support parameterized TidPaths.
Up to now we've not worried much about joins where the join key is a
relation's CTID column, reasoning that storing a table's CTIDs in some
other table would be pretty useless. However, there are use-cases for
this sort of query involving self-joins, so that argument doesn't really
hold water.
This patch allows generating plans for joins on CTID that use a nestloop
with inner TidScan, similar to what we might do with an index on the join
column. This is the most efficient way to join when the outer side of
the nestloop is expected to yield relatively few rows.
This change requires upgrading tidpath.c and the generated TidPaths
to work with RestrictInfos instead of bare qual clauses, but that's
long-postponed technical debt anyway.
Discussion: https://postgr.es/m/17443.1545435266@sss.pgh.pa.us1 parent 6f19a8c commit b5415e3
File tree
8 files changed
+415
-140
lines changed- src
- backend/optimizer
- path
- plan
- util
- include/nodes
- test/regress
- expected
- sql
8 files changed
+415
-140
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1202 | 1202 | | |
1203 | 1203 | | |
1204 | 1204 | | |
1205 | | - | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
1206 | 1209 | | |
1207 | 1210 | | |
1208 | | - | |
| 1211 | + | |
1209 | 1212 | | |
1210 | 1213 | | |
1211 | 1214 | | |
1212 | 1215 | | |
1213 | | - | |
| 1216 | + | |
1214 | 1217 | | |
1215 | 1218 | | |
1216 | 1219 | | |
| |||
0 commit comments