pgsql: Allow parallel create index to accumulate buffer usage stats.

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Allow parallel create index to accumulate buffer usage stats.
Date: 2020-04-09 04:43:40
Message-ID: E1jMP2S-0004b4-1E@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Allow parallel create index to accumulate buffer usage stats.

Currently, we don't account for buffer usage incurred by parallel workers
for parallel create index.  This commit allows each worker to record the
buffer usage stats and leader backend to accumulate that stats at the
end of the operation.  This will allow pg_stat_statements to display
correct buffer usage stats for (parallel) create index command.

Reported-by: Julien Rouhaud
Author: Sawada Masahiko
Reviewed-by: Dilip Kumar, Julien Rouhaud and Amit Kapila
Backpatch-through: 11, where this was introduced
Discussion: https://postgr.es/m/20200328151721.GB12854@nol

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5c71362174eb56676f8b91c73ec066dd5513fd4b

Modified Files
--------------
src/backend/access/nbtree/nbtsort.c | 34 +++++++++++++++++++++++++---------
src/backend/executor/instrument.c | 10 +++-------
2 files changed, 28 insertions(+), 16 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2020-04-09 06:52:26 Re: pgsql: Implement waiting for given lsn at transaction start
Previous Message Fujii Masao 2020-04-09 03:57:19 pgsql: Add note in pg_stat_statements documentation about planning stat