Re: Making all nbtree entries unique by having heap TIDs participate in comparisons
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>,
Dmitry Dolgov <9erthalion6@gmail.com>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Alexander Korotkov <a.korotkov@postgrespro.ru>,
Thomas Munro <thomas.munro@enterprisedb.com>, Claudio Freire <klaussfreire@gmail.com>, Anastasia Lubennikova <a.lubennikova@postgrespro.ru>, "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
Date: 2019-03-12T18:32:16Z
Lists: pgsql-hackers
On Mon, Mar 11, 2019 at 10:47 PM Peter Geoghegan <pg@bowt.ie> wrote: > > On Sun, Mar 10, 2019 at 5:17 PM Peter Geoghegan <pg@bowt.ie> wrote: > > The regression that I mentioned earlier isn't in pgbench type > > workloads (even when the distribution is something more interesting > > that the uniform distribution default). It is only in workloads with > > lots of page splits and lots of index churn, where we get most of the > > benefit of the patch, but also where the costs are most apparent. > > Hopefully it can be fixed, but if not I'm inclined to think that it's > > a price worth paying. This certainly still needs further analysis and > > discussion, though. This revision of the patch does not attempt to > > address that problem in any way. > > I believe that I've figured out what's going on here. > > At first, I thought that this regression was due to the cycles that > have been added to page splits, but that doesn't seem to be the case > at all. Nothing that I did to make page splits faster helped (e.g. > temporarily go back to doing them "bottom up" made no difference). CPU > utilization was consistently slightly *higher* with the master branch > (patch spent slightly more CPU time idle). I now believe that the > problem is with LWLock/buffer lock contention on index pages, and that > that's an inherent cost with a minority of write-heavy high contention > workloads. A cost that we should just accept. If I wanted to try to say this in fewer words, would it be fair to say that reducing the size of an index by 40% without changing anything else can increase contention on the remaining pages? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Add "split after new tuple" nbtree optimization.
- f21668f328c8 12.0 landed
-
Add nbtree high key "continuescan" optimization.
- 29b64d1de7c7 12.0 landed
-
Allow amcheck to re-find tuples using new search.
- c1afd175b5b2 12.0 landed
-
Consider secondary factors during nbtree splits.
- fab250243387 12.0 landed
-
Make heap TID a tiebreaker nbtree index column.
- dd299df8189b 12.0 landed
-
Refactor nbtree insertion scankeys.
- e5adcb789d80 12.0 landed
-
Redesign the partition dependency mechanism.
- 1d92a0c9f7dd 12.0 cited
-
Avoid unnecessary palloc overhead in _bt_first(). The temporary
- d961a5689966 8.1.0 cited