• Amit Kapila's avatar
    Allow parallel create index to accumulate buffer usage stats. · 5c713621
    Amit Kapila authored
    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
    5c713621
instrument.c 7.5 KB