Fix tuple counting in SP-GiST index build.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 46f80803a1273836b818a60127ae01a891c42c85
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2018-03-22T17:23:48Z
Releases: 9.3.23
Fix tuple counting in SP-GiST index build.

Count the number of tuples in the index honestly, instead of assuming
that it's the same as the number of tuples in the heap.  (It might be
different if the index is partial.)

Back-patch to all supported versions.

Tomas Vondra

Discussion: https://postgr.es/m/3b3d8eac-c709-0d25-088e-b98339a1b28a@2ndquadrant.com

Files

PathChange+/−
src/backend/access/spgist/spginsert.c modified +7 −1

Discussion