aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/parallel.c
diff options
context:
space:
mode:
authorTomas Vondra <tomas.vondra@postgresql.org>2023-12-08 17:07:30 +0100
committerTomas Vondra <tomas.vondra@postgresql.org>2023-12-08 17:14:32 +0100
commitdae761a87edae444d11a411f711f1d679bed5941 (patch)
tree9c98e722318c9390a8c971b32538adadcc1a4bc1 /src/backend/access/transam/parallel.c
parent00edb2061fcf288574b7b5c0be67fab71f7e136b (diff)
downloadpostgresql-dae761a87edae444d11a411f711f1d679bed5941.tar.gz
postgresql-dae761a87edae444d11a411f711f1d679bed5941.zip
Add empty BRIN ranges during CREATE INDEX
When building BRIN indexes, the brinbuildCallback only advances to the next page range when seeing a tuple that doesn't belong to the current one. This means that the index may end up missing ranges at the end of the table, if those pages do not contain any indexable tuples. We tend not to have completely empty pages at the end of a relation, but this also applies to partial indexes, where the tuples may simply not match the index predicate. This results in inefficient scans using the affected BRIN index - without the summaries, the page ranges have to be read and processed, which consumes I/O and possibly also CPU time. The existing code already added empty ranges for earlier parts of the table, this commit makes sure we add them for the ranges at the end of the table too. Patch by Matthias van de Meent, with review/improvements by me. Author: Matthias van de Meent Reviewed-by: Tomas Vondra Discussion: https://postgr.es/m/CAEze2WiMsPZg%3DxkvSF_jt4%3D69k6K7gz5B8V2wY3gCGZ%2B1BzCbQ%40mail.gmail.com
Diffstat (limited to 'src/backend/access/transam/parallel.c')
0 files changed, 0 insertions, 0 deletions