postgres.git / summary / log / commit / refs
commit b17870d754665c4b431d3ce4de6676832a0b10a0
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Fri Nov 03 19:36:32 2017 +0000
First released in: 11.0, 10.1
Fix thinkos in BRIN summarization
The previous commit contained a thinko that made a single-range
summarization request process from there to end of table. Fix by
setting the correct end range point. Per buildfarm.
src/backend/access/brin/brin.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c
index 3e2e4ad4e6c..4f0ff79cb49 100644
--- a/src/backend/access/brin/brin.c
+++ b/src/backend/access/brin/brin.c
@@ -1290,8 +1290,11 @@ brinsummarize(Relation index, Relation heapRel, BlockNumber pageRange,
if (pageRange == BRIN_ALL_BLOCKRANGES)
startBlk = 0;
else
+ {
startBlk = (pageRange / pagesPerRange) * pagesPerRange;
- if (startBlk >= heapNumBlocks)
+ heapNumBlocks = Min(heapNumBlocks, startBlk + pagesPerRange);
+ }
+ if (startBlk > heapNumBlocks)
{
/* Nothing to do if start point is beyond end of table */
brinRevmapTerminate(revmap);
[parent: 5159626afbe9]