forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit789d3d4
committed
Fix EXPLAIN to handle gating Result nodes within inner-indexscan subplans.
It is possible for a NestLoop plan node to pass an OUTER Var into an"inner indexscan" that is an Append construct (derived from an inheritancetree or UNION ALL subquery). The OUTER tuple is then passed down atruntime to the leaf indexscan node(s) where it will actually be used.EXPLAIN has to likewise pass the information about the nestloop's outersubplan down through the Append node, else it will fail to print theouter-reference Vars (with complaints like "bogus varno: 65001").However, there was a case missed in all this: we could also have gatingResult nodes that were inserted into the appendrel plan tree to deal withpseudoconstant qual conditions. So EXPLAIN has to pass down the outer plannode to a Result's subplan, too. Per example from Jon Nelson.The problem is gone in 9.1 because we replaced the nestloop outer-tuplekluge with a Param-based data transfer mechanism. Also, so far as I cantell, the case can't happen before 8.4 because of restrictions on whatsorts of appendrel members could be pulled up into the parent query.So this patch is only needed for 8.4 and 9.0.1 parent4624228 commit789d3d4
1 file changed
+5
-2
lines changedLines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1179 | 1179 |
| |
1180 | 1180 |
| |
1181 | 1181 |
| |
1182 |
| - | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
1183 | 1185 |
| |
1184 | 1186 |
| |
1185 |
| - | |
| 1187 | + | |
| 1188 | + | |
1186 | 1189 |
| |
1187 | 1190 |
| |
1188 | 1191 |
| |
|
0 commit comments
Comments
(0)