Re: [ADMIN] since when has pg_stat_user_indexes.idx_scan been counting?

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: [ADMIN] since when has pg_stat_user_indexes.idx_scan been counting?
Date: 2011-05-12 20:46:16
Message-ID: 4DCC4718.8000409@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

Dne 12.5.2011 22:03, Willy-Bas Loos napsal(a):
> Then, are the index scans counted in a memory variable and written at
> analyze time?

No, I believe raghu mixed two things - stats used by the planner and
stats about access to the data (how many tuples were read using an
index, etc.)

Stats for the planner are stored in pg_class/pg_statistic/pg_stats
catalogs and are updated by ANALYZE (either manual or automatic). This
is what raghu refered to, but these stats are completely useless when
looking for unused indexes.

Stats about access to the data (index/seq scans, cache hit ratio etc.)
are stored in pg_stat_* and pg_statio_* catalogs, and are updated after
running each query. AFAIK it's not a synchronous process, but when a
backend finishes a query, it sends the stats to the postmaster (and
postmaster updates the catalogs).

Tomas

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Neal Brown 2011-05-12 20:46:42 cacti graph templates for check_postgres --dbstats
Previous Message Tom Lane 2011-05-12 20:16:18 Re: since when has pg_stat_user_indexes.idx_scan been counting?

Browse pgsql-performance by date

  From Date Subject
Next Message Maciek Sakrejda 2011-05-12 21:07:03 Re: Poor performance when joining against inherited tables
Previous Message Tom Lane 2011-05-12 20:16:18 Re: since when has pg_stat_user_indexes.idx_scan been counting?