Avoid dynahash's freelist in BufferAlloc.

Поиск
Список
Период
Сортировка
От Yura Sokolov
Тема Avoid dynahash's freelist in BufferAlloc.
Дата
Msg-id 4f7766222a461703dc4f2ccf333189f1afecbe7a.camel@postgrespro.ru
обсуждение исходный текст
Список pgsql-hackers
Good day.

I found BufferAlloc unnecessary goes through dynahash's freelist when it
reuses valid buffer.

If it is avoided and dynahash's entry directly moved, 1-2% is gained in
select only pgbench (with scale factor 100 in 50 connections/50 threads
on 4 core 8ht notebook cpu 185krps=>190krps).

I've changed speculative call to BufferInsert to BufferLookup to avoid
insertion too early. (It also saves call to BufferDelete if conflicting
entry is already in). Then if buffer is valid and no conflicting entry
in a dynahash I'm moving old dynahash entry directly and without check
(since we already did the check).

If old buffer were invalid, new entry is unavoidably fetched from
freelist and inserted (also without check). But in steady state (if
there is no dropped/truncated tables/indices/databases) it is rare case.

Regards,
Sokolov Yura @ Postgres Professional
y.sokolov@postgrespro.ru
funny.falcon@gmail.com

Вложения

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

Предыдущее
От: Yugo NAGATA
Дата:
Сообщение: Re: Implementing Incremental View Maintenance
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: POC: Cleaning up orphaned files using undo logs