pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix deduplication "single value" strategy bug.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix deduplication "single value" strategy bug.
@ 2020-06-19 15:58 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Geoghegan @ 2020-06-19 15:58 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix deduplication "single value" strategy bug.

It was possible for deduplication's single value strategy to mistakenly
believe that a very small duplicate tuple counts as one of the six large
tuples that it aims to leave behind after the page finally splits.  This
could cause slightly suboptimal space utilization with very low
cardinality indexes, though only under fairly narrow conditions.

To fix, be particular about what kind of tuple counts as a
maxpostingsize-capped tuple.  This avoids confusion in the event of a
small tuple that gets "wedged" between two large tuples, where all
tuples on the page are duplicates of the same value.

Discussion: https://postgr.es/m/CAH2-Wz=Y+sgSFc-O3LpiZX-POx2bC+okec2KafERHuzdVa7-rQ@mail.gmail.com
Backpatch: 13-, where deduplication was introduced (by commit 0d861bbb)

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/be14f884d57bc9c8ec8415edafea35ba5d31af59

Modified Files
--------------
src/backend/access/nbtree/nbtdedup.c | 41 ++++++++++++++++++++++++------------
src/backend/access/nbtree/nbtsort.c  |  2 ++
src/backend/access/nbtree/nbtxlog.c  |  1 +
src/include/access/nbtree.h          |  1 +
4 files changed, 32 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix deduplication "single value" strategy bug.
@ 2020-06-19 15:58 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Geoghegan @ 2020-06-19 15:58 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix deduplication "single value" strategy bug.

It was possible for deduplication's single value strategy to mistakenly
believe that a very small duplicate tuple counts as one of the six large
tuples that it aims to leave behind after the page finally splits.  This
could cause slightly suboptimal space utilization with very low
cardinality indexes, though only under fairly narrow conditions.

To fix, be particular about what kind of tuple counts as a
maxpostingsize-capped tuple.  This avoids confusion in the event of a
small tuple that gets "wedged" between two large tuples, where all
tuples on the page are duplicates of the same value.

Discussion: https://postgr.es/m/CAH2-Wz=Y+sgSFc-O3LpiZX-POx2bC+okec2KafERHuzdVa7-rQ@mail.gmail.com
Backpatch: 13-, where deduplication was introduced (by commit 0d861bbb)

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/dedb92d4a3adc6b5165a619383739ab05d24b24d

Modified Files
--------------
src/backend/access/nbtree/nbtdedup.c | 41 ++++++++++++++++++++++++------------
src/backend/access/nbtree/nbtsort.c  |  2 ++
src/backend/access/nbtree/nbtxlog.c  |  1 +
src/include/access/nbtree.h          |  1 +
4 files changed, 32 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-06-19 15:58 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-06-19 15:58 pgsql: Fix deduplication "single value" strategy bug. Peter Geoghegan <pg@bowt.ie>
2020-06-19 15:58 pgsql: Fix deduplication "single value" strategy bug. Peter Geoghegan <pg@bowt.ie>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox