On Fri, Aug 4, 2017 at 3:30 PM, Peter Geoghegan <p...@bowt.ie> wrote: > Yura Sokolov of Postgres Pro performed this benchmark at my request. > He took the 9.5 commit immediately proceeding 2ed5b87f9 as a baseline.
I attach a simple patch that comments out the release of the buffer pin for logged tables where an MVCC snapshot is used for a scan that is not an index-only scan. This is the simplest way of evaluating the effects of disabling 2ed5b87f9. Yura or others may find this helpful. To be clear, I am certainly not suggesting that we should revert 2ed5b87f9. I do think that we need to give serious thought to fixing the regression that 2ed5b87f9 introduced for LP_DEAD setting by index scans, though. -- Peter Geoghegan
diff --git a/src/backend/access/nbtree/nbtsearch.c b/src/backend/access/nbtree/nbtsearch.c new file mode 100644 index 642c894..696beda *** a/src/backend/access/nbtree/nbtsearch.c --- b/src/backend/access/nbtree/nbtsearch.c *************** _bt_drop_lock_and_maybe_pin(IndexScanDes *** 58,63 **** --- 58,64 ---- { LockBuffer(sp->buf, BUFFER_LOCK_UNLOCK); + #if 0 if (IsMVCCSnapshot(scan->xs_snapshot) && RelationNeedsWAL(scan->indexRelation) && !scan->xs_want_itup) *************** _bt_drop_lock_and_maybe_pin(IndexScanDes *** 65,70 **** --- 66,72 ---- ReleaseBuffer(sp->buf); sp->buf = InvalidBuffer; } + #endif }
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers