forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitaf52770
committed
Adjust design of per-worker parallel seqscan data struct
The design of the data structures which allow storage of the per-workermemory during parallel seq scans were not ideal. The work done in56788d2 required an additional data structure to allow workers toremember the range of pages that had been allocated to them forprocessing during a parallel seqscan. That commit added a void pointerfield to TableScanDescData to allow heapam to store the per-workerallocation information. However putting the field there made very littlesense given that we have AM specific structs for that, e.g.HeapScanDescData.Here we remove the void pointer field from TableScanDescData and add adedicated field for this purpose to HeapScanDescData.Previously we also allocated memory for this parallel per-worker data forall scans, regardless if it was a parallel scan or not. This was just awasted allocation for non-parallel scans, so here we make the allocationconditional on the scan being parallel.Also, add previously missing pfree() to free the per-worker data inheap_endscan().Reported-by: Andres FreundReviewed-by: Andres FreundDiscussion:https://postgr.es/m/20210317023101.anvejcfotwka6gaa@alap3.anarazel.de1 parent6d7a6fe commitaf52770
3 files changed
+22
-7
lines changedLines changed: 16 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
540 | 540 |
| |
541 | 541 |
| |
542 | 542 |
| |
543 |
| - | |
| 543 | + | |
544 | 544 |
| |
545 | 545 |
| |
546 | 546 |
| |
| |||
748 | 748 |
| |
749 | 749 |
| |
750 | 750 |
| |
751 |
| - | |
| 751 | + | |
752 | 752 |
| |
753 | 753 |
| |
754 | 754 |
| |
| |||
864 | 864 |
| |
865 | 865 |
| |
866 | 866 |
| |
867 |
| - | |
| 867 | + | |
868 | 868 |
| |
869 | 869 |
| |
870 | 870 |
| |
| |||
1057 | 1057 |
| |
1058 | 1058 |
| |
1059 | 1059 |
| |
1060 |
| - | |
| 1060 | + | |
1061 | 1061 |
| |
1062 | 1062 |
| |
1063 | 1063 |
| |
| |||
1194 | 1194 |
| |
1195 | 1195 |
| |
1196 | 1196 |
| |
1197 |
| - | |
1198 |
| - | |
1199 | 1197 |
| |
1200 | 1198 |
| |
1201 | 1199 |
| |
| |||
1231 | 1229 |
| |
1232 | 1230 |
| |
1233 | 1231 |
| |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
1234 | 1241 |
| |
1235 | 1242 |
| |
1236 | 1243 |
| |
| |||
1306 | 1313 |
| |
1307 | 1314 |
| |
1308 | 1315 |
| |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
1309 | 1319 |
| |
1310 | 1320 |
| |
1311 | 1321 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
65 | 65 |
| |
66 | 66 |
| |
67 | 67 |
| |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
68 | 74 |
| |
69 | 75 |
| |
70 | 76 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
49 |
| - | |
50 | 49 |
| |
51 | 50 |
| |
52 | 51 |
| |
|
0 commit comments
Comments
(0)