pgsql: Add "split after new tuple" nbtree optimization.

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема pgsql: Add "split after new tuple" nbtree optimization.
Дата
Msg-id E1h8SjN-0002fB-2L@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Add "split after new tuple" nbtree optimization.

Add additional heuristics to the algorithm for locating an optimal split
location.  New logic identifies localized monotonically increasing
values in indexes with multiple columns.  When this insertion pattern is
detected, page splits split just after the new item that provoked a page
split (or apply leaf fillfactor in the style of a rightmost page split).
This optimization is a variation of the long established leaf fillfactor
optimization used during rightmost page splits.

50/50 page splits are only appropriate with a pattern of truly random
insertions, where the average space utilization ends up at 65% - 70%.
Without this patch, affected cases have leaf pages that are no more than
about 50% full on average.  Future insertions can never make use of the
free space left behind.  With this patch, affected cases have leaf pages
that are about 90% full on average (assuming a fillfactor of 90).

Localized monotonically increasing insertion patterns are presumed to be
fairly common in real-world applications.  There is a fair amount of
anecdotal evidence for this.  Both pg_depend system catalog indexes
(pg_depend_depender_index and pg_depend_reference_index) are at least
20% smaller after the regression tests are run when the optimization is
available.  Furthermore, many of the indexes created by a fair use
implementation of TPC-C for Postgres are consistently about 40% smaller
when the optimization is available.

Note that even pg_upgrade'd v3 indexes make use of this optimization.

Author: Peter Geoghegan
Reviewed-By: Heikki Linnakangas
Discussion: https://postgr.es/m/CAH2-WzkpKeZJrXvR_p7VSY1b-s85E3gHyTbZQzR0BkJ5LrWF_A@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/access/nbtree/nbtsplitloc.c | 214 +++++++++++++++++++++++++++++++-
1 file changed, 211 insertions(+), 3 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: pgsql: Further code review for new integerset code.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Suppress Append and MergeAppend plan nodes that have a singlech