|From:||Yura Sokolov <y(dot)sokolov(at)postgrespro(dot)ru>|
|Subject:||Avoid dynahash's freelist in BufferAlloc.|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
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.
Sokolov Yura @ Postgres Professional
|Next Message||Amit Kapila||2021-09-22 11:15:48||Re: POC: Cleaning up orphaned files using undo logs|
|Previous Message||Yugo NAGATA||2021-09-22 10:17:12||Re: Implementing Incremental View Maintenance|