aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/postgres_fdw.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2021-03-30 10:17:09 +1300
committerDavid Rowley <drowley@postgresql.org>2021-03-30 10:17:09 +1300
commitaf527705edc3fd0b335264d17e0521c05edc5cca (patch)
tree11f0d9972f7f2602394cc9b0ead1194a9515de2f /contrib/postgres_fdw/postgres_fdw.c
parent6d7a6feac48b1970c4cd127ee65d4c487acbb5e9 (diff)
downloadpostgresql-af527705edc3fd0b335264d17e0521c05edc5cca.tar.gz
postgresql-af527705edc3fd0b335264d17e0521c05edc5cca.zip
Adjust design of per-worker parallel seqscan data struct
The design of the data structures which allow storage of the per-worker memory during parallel seq scans were not ideal. The work done in 56788d215 required an additional data structure to allow workers to remember the range of pages that had been allocated to them for processing during a parallel seqscan. That commit added a void pointer field to TableScanDescData to allow heapam to store the per-worker allocation information. However putting the field there made very little sense given that we have AM specific structs for that, e.g. HeapScanDescData. Here we remove the void pointer field from TableScanDescData and add a dedicated field for this purpose to HeapScanDescData. Previously we also allocated memory for this parallel per-worker data for all scans, regardless if it was a parallel scan or not. This was just a wasted allocation for non-parallel scans, so here we make the allocation conditional on the scan being parallel. Also, add previously missing pfree() to free the per-worker data in heap_endscan(). Reported-by: Andres Freund Reviewed-by: Andres Freund Discussion: https://postgr.es/m/20210317023101.anvejcfotwka6gaa@alap3.anarazel.de
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
0 files changed, 0 insertions, 0 deletions