pgsql: Add some randomness to the choice of which GiST page to insert t

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Add some randomness to the choice of which GiST page to insert t
Дата
Msg-id E1Tyklw-0004Cv-GV@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Add some randomness to the choice of which GiST page to insert to.

When descending the tree for an insert, and there are multiple equally good
pages we could insert to, make the choice in random. Previously, we would
always choose the tuple with lowest offset number. That meant that when two
non-leaf pages overlap - in the extreme case they might have exactly the same
key - all but the first such page went unused. That wasn't optimal for space
usage; if you deleted some tuples from the non-first pages, the space would
never be reused.

With this patch, the other pages are sometimes chosen too, although there's
still a heavy bias towards low-offset tuples, so that we don't lose cache
locality when doing a lot of inserts with similar keys.

Original idea by Alexander Korotkov, although this patch version was written
by me and copy-edited by Tom Lane.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/ba1cc6501e98aee7d43098b032d6656f243bca5b

Modified Files
--------------
src/backend/access/gist/gistutil.c |   66 +++++++++++++++++++++++++++++++++--
1 files changed, 62 insertions(+), 4 deletions(-)


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: pgsql: Make pg_dump exclude unlogged table data on hot standby slaves
Следующее
От: Bruce Momjian
Дата:
Сообщение: pgsql: doc: improve wording of "foreign data server" in file-fdw docs