forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit336c1d7
committed
Avoid assuming that index-only scan data matches the index's rowtype.
In general the data returned by an index-only scan should have thedatatypes originally computed by FormIndexDatum. If the index opclassesuse "storage" datatypes different from their input datatypes, the scantuple will not have the same rowtype attributed to the index; but we hada hard-wired assumption that that was true in nodeIndexonlyscan.c. We'dalready hacked around the issue for the one case where the types aredifferent in btree indexes (btree name_ops), but this would definitelycome back to bite us if we ever implement index-only scans in GiST.To fix, require the index AM to explicitly provide the tupdesc for thetuple it is returning. btree can just pass back the index's tupdesc, butGiST will have to work harder when and if it supports index-only scans.I had previously proposed fixing this by allowing the index AM to fill thescan tuple slot directly; but on reflection that seemed like a modulelayering violation, since TupleTableSlots are creatures of the executor.At least in the btree case, it would also be less efficient, since thetuple deconstruction work would occur even for rows later found to beinvisible to the scan's snapshot.1 parente661c3d commit336c1d7
File tree
5 files changed
+17
-10
lines changed- doc/src/sgml
- src
- backend
- access
- index
- nbtree
- executor
- include/access
5 files changed
+17
-10
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
396 | 396 |
| |
397 | 397 |
| |
398 | 398 |
| |
399 |
| - | |
| 399 | + | |
| 400 | + | |
400 | 401 |
| |
401 | 402 |
| |
402 | 403 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
112 | 112 |
| |
113 | 113 |
| |
114 | 114 |
| |
| 115 | + | |
115 | 116 |
| |
116 | 117 |
| |
117 | 118 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
433 | 433 |
| |
434 | 434 |
| |
435 | 435 |
| |
436 |
| - | |
| 436 | + | |
| 437 | + | |
437 | 438 |
| |
438 | 439 |
| |
439 | 440 |
| |
440 | 441 |
| |
441 | 442 |
| |
| 443 | + | |
| 444 | + | |
442 | 445 |
| |
443 | 446 |
| |
444 | 447 |
| |
|
Lines changed: 8 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
39 |
| - | |
| 39 | + | |
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
| |||
114 | 114 |
| |
115 | 115 |
| |
116 | 116 |
| |
117 |
| - | |
| 117 | + | |
118 | 118 |
| |
119 | 119 |
| |
120 | 120 |
| |
| |||
151 | 151 |
| |
152 | 152 |
| |
153 | 153 |
| |
154 |
| - | |
| 154 | + | |
155 | 155 |
| |
156 |
| - | |
157 |
| - | |
| 156 | + | |
158 | 157 |
| |
159 | 158 |
| |
160 | 159 |
| |
161 | 160 |
| |
162 | 161 |
| |
163 |
| - | |
| 162 | + | |
164 | 163 |
| |
165 | 164 |
| |
166 |
| - | |
| 165 | + | |
| 166 | + | |
167 | 167 |
| |
168 | 168 |
| |
169 | 169 |
| |
170 | 170 |
| |
171 | 171 |
| |
172 |
| - | |
| 172 | + | |
173 | 173 |
| |
174 | 174 |
| |
175 | 175 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| 20 | + | |
20 | 21 |
| |
21 | 22 |
| |
22 | 23 |
| |
| |||
80 | 81 |
| |
81 | 82 |
| |
82 | 83 |
| |
| 84 | + | |
83 | 85 |
| |
84 | 86 |
| |
85 | 87 |
| |
|
0 commit comments
Comments
(0)