- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitd96d1d5
committed
Fix incorrect slot type in BuildTupleHashTableExt
0f57382 adjusted the execGrouping.c code so it made use of ExprStates togenerate hash values. That commit made a wrong assumption that the slottype to pass to ExecBuildHash32FromAttrs() is always &TTSOpsMinimalTuple.That's not the case as the slot type depends on the slot type passed toLookupTupleHashEntry(), which for nodeRecursiveunion.c, could be any ofthe current slot types.Here we fix this by adding a new parameter to BuildTupleHashTableExt()to allow the slot type to be passed in. In the case of nodeSubplan.cand nodeAgg.c the slot type is always &TTSOpsVirtual, so for both ofthose cases, it's beneficial to pass the known slot type as that allowsExecBuildHash32FromAttrs() to skip adding the tuple deform step to theresulting ExprState. Another possible fix would have been to haveExecBuildHash32FromAttrs() set "fetch.kind" to NULL so thatExecComputeSlotInfo() always determines the EEOP_INNER_FETCHSOME isrequired, however, that option isn't favorable as slows down aggregationand hashed subplan evaluation due to the extra (needless) deform step.Thanks to Nathan Bossart for bisecting to find the offending commitbased on Paul's report.Reported-by: Paul Ramsey <pramsey@cleverelephant.ca>Discussion:https://postgr.es/m/99F064C1-B3EB-4BE7-97D2-D2A0AA487A71@cleverelephant.ca1 parent84f1b0b commitd96d1d5
File tree
8 files changed
+50
-1
lines changed- src
- backend/executor
- include/executor
- test/regress
- expected
- sql
8 files changed
+50
-1
lines changedLines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
135 | 135 |
| |
136 | 136 |
| |
137 | 137 |
| |
| 138 | + | |
138 | 139 |
| |
139 | 140 |
| |
140 | 141 |
| |
| |||
154 | 155 |
| |
155 | 156 |
| |
156 | 157 |
| |
| 158 | + | |
157 | 159 |
| |
158 | 160 |
| |
159 | 161 |
| |
| |||
225 | 227 |
| |
226 | 228 |
| |
227 | 229 |
| |
228 |
| - | |
| 230 | + | |
229 | 231 |
| |
230 | 232 |
| |
231 | 233 |
| |
| |||
274 | 276 |
| |
275 | 277 |
| |
276 | 278 |
| |
| 279 | + | |
277 | 280 |
| |
278 | 281 |
| |
279 | 282 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1520 | 1520 |
| |
1521 | 1521 |
| |
1522 | 1522 |
| |
| 1523 | + | |
1523 | 1524 |
| |
1524 | 1525 |
| |
1525 | 1526 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
| 40 | + | |
40 | 41 |
| |
41 | 42 |
| |
| 43 | + | |
42 | 44 |
| |
43 | 45 |
| |
44 | 46 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
128 | 128 |
| |
129 | 129 |
| |
130 | 130 |
| |
| 131 | + | |
131 | 132 |
| |
132 | 133 |
| |
133 | 134 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
519 | 519 |
| |
520 | 520 |
| |
521 | 521 |
| |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
522 | 527 |
| |
523 | 528 |
| |
524 | 529 |
| |
| |||
533 | 538 |
| |
534 | 539 |
| |
535 | 540 |
| |
| 541 | + | |
536 | 542 |
| |
537 | 543 |
| |
538 | 544 |
| |
| |||
561 | 567 |
| |
562 | 568 |
| |
563 | 569 |
| |
| 570 | + | |
564 | 571 |
| |
565 | 572 |
| |
566 | 573 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
140 | 140 |
| |
141 | 141 |
| |
142 | 142 |
| |
| 143 | + | |
143 | 144 |
| |
144 | 145 |
| |
145 | 146 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
329 | 329 |
| |
330 | 330 |
| |
331 | 331 |
| |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
332 | 352 |
| |
333 | 353 |
| |
334 | 354 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
216 | 216 |
| |
217 | 217 |
| |
218 | 218 |
| |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
219 | 233 |
| |
220 | 234 |
| |
221 | 235 |
| |
|
0 commit comments
Comments
(0)