On Postgres 8.4 when you do:
select * from pg_stat_all_indexes where relname = 'table_name';
It returns the fields idx_tup_read and idx_tup_fetch, what is the difference?
index-statisticspostgresql
On Postgres 8.4 when you do:
select * from pg_stat_all_indexes where relname = 'table_name';
It returns the fields idx_tup_read and idx_tup_fetch, what is the difference?
Best Answer
When looking at the source code of the view, then you'll see that
idx_tup_read
is the result of callingpg_stat_get_tuples_returned()
andidx_tup_fetch
is the result of callingpg_stat_get_tuples_fetched()
The manual describes the two functions as follows: