mirror of
https://github.com/postgres/postgres.git
synced 2025-07-24 14:22:24 +03:00
Track shared buffer hits in pg_stat_io
Among other things, this should make it easier to calculate a useful cache hit ratio by excluding buffer reads via buffer access strategies. As buffer access strategies reuse buffers (and thus evict the prior buffer contents), it is normal to see reads on repeated scans of the same data. Author: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CAAKRu_beMa9Hzih40%3DXPYqhDVz6tsgUGTrhZXRo%3Dunp%2Bszb%3DUA%40mail.gmail.com
This commit is contained in:
@ -1259,6 +1259,7 @@ typedef enum io_stat_col
|
||||
IO_COL_WRITES,
|
||||
IO_COL_EXTENDS,
|
||||
IO_COL_CONVERSION,
|
||||
IO_COL_HITS,
|
||||
IO_COL_EVICTIONS,
|
||||
IO_COL_REUSES,
|
||||
IO_COL_FSYNCS,
|
||||
@ -1277,16 +1278,18 @@ pgstat_get_io_op_index(IOOp io_op)
|
||||
{
|
||||
case IOOP_EVICT:
|
||||
return IO_COL_EVICTIONS;
|
||||
case IOOP_EXTEND:
|
||||
return IO_COL_EXTENDS;
|
||||
case IOOP_FSYNC:
|
||||
return IO_COL_FSYNCS;
|
||||
case IOOP_HIT:
|
||||
return IO_COL_HITS;
|
||||
case IOOP_READ:
|
||||
return IO_COL_READS;
|
||||
case IOOP_REUSE:
|
||||
return IO_COL_REUSES;
|
||||
case IOOP_WRITE:
|
||||
return IO_COL_WRITES;
|
||||
case IOOP_EXTEND:
|
||||
return IO_COL_EXTENDS;
|
||||
case IOOP_FSYNC:
|
||||
return IO_COL_FSYNCS;
|
||||
}
|
||||
|
||||
elog(ERROR, "unrecognized IOOp value: %d", io_op);
|
||||
|
Reference in New Issue
Block a user