pgsql: pgstattuple: Optimize btree and hash index functions with stream

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pgstattuple: Optimize btree and hash index functions with stream
Date: 2026-03-13 01:48:58
Message-ID: E1w0re6-003hAl-0q@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pgstattuple: Optimize btree and hash index functions with streaming read

This commit replaces the synchronous ReadBufferExtended() loops with the
streaming read routines, affecting pgstatindex() (for btree) and
pgstathashindex() (for hash indexes).

Under test conditions similar to 6c228755add8 (some dm_delay and
debug_io_direct=data), this can result in nice runtime and IO gains.

Author: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Reviewed-by: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
Discussion: https://postgr.es/m/CABPTF7VrqfbcDXqGrdLQ2xaQ=K0RzExNuw6U_GGqzSJu32wfdQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/213f0079b3415ad8f5f0a62d119ed1f0a448ad8f

Modified Files
--------------
contrib/pgstattuple/pgstatindex.c | 66 ++++++++++++++++++++++++++++++++-------
1 file changed, 55 insertions(+), 11 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2026-03-13 06:14:38 pgsql: Change copyObject() to use typeof_unqual
Previous Message Jeff Davis 2026-03-13 01:15:09 Re: pgsql: CREATE SUBSCRIPTION ... SERVER.