diff options
author | Tomas Vondra <tomas.vondra@postgresql.org> | 2023-12-30 22:59:42 +0100 |
---|---|---|
committer | Tomas Vondra <tomas.vondra@postgresql.org> | 2023-12-30 23:17:01 +0100 |
commit | cb44a8345e7c248cf4158f2702fd9c9358399cfb (patch) | |
tree | b33aac373edf141423d52a64039d005d83247d47 /src/backend/access/gist/gistbuildbuffers.c | |
parent | 6c63bcbf3ccf555f02a8fd8b2acaf01a6e94cb97 (diff) | |
download | postgresql-cb44a8345e7c248cf4158f2702fd9c9358399cfb.tar.gz postgresql-cb44a8345e7c248cf4158f2702fd9c9358399cfb.zip |
Fix parallel BRIN builds with synchronized scans
The brinbuildCallbackParallel callback used by parallel BRIN builds did
not consider that the parallel table scans may be synchronized, starting
from an arbitrary block and then wrap around.
If this happened and the scan actually did wrap around, tuples from the
beginning of the table were added to the last range produced by the same
worker. The index would be missing range at the beginning of the table,
while the last range would be too wide. This would not produce incorrect
query results, but it'd be less efficient.
Fixed by checking for both past and future ranges in the callback. The
worker may produce multiple summaries for the same page range, but the
leader will merge them as if the summaries came from different workers.
Discussion: https://postgr.es/m/c2ee7d69-ce17-43f2-d1a0-9811edbda6e6%40enterprisedb.com
Diffstat (limited to 'src/backend/access/gist/gistbuildbuffers.c')
0 files changed, 0 insertions, 0 deletions