From: Tomas Vondra <tv@fuzzy.cz>
To: pgsql-performance@postgresql.org
Subject: Re: [ADMIN] since when has pg_stat_user_indexes.idx_scan been counting?
Date: Thu, 12 May 2011 22:46:16 +0200
Message-ID: <4DCC4718.8000409@fuzzy.cz> (raw)
In-Reply-To: <BANLkTinTsg18Wk9+JPrpfOXCkn-W0D2TNw@mail.gmail.com>
References: <BANLkTikhNLPhCjE819=RFG-+CB6UV4GbUA@mail.gmail.com>
<BANLkTimeo-P+=fxKzui1Md2Siq_YJ7ASug@mail.gmail.com>
<BANLkTinTsg18Wk9+JPrpfOXCkn-W0D2TNw@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tv@fuzzy.cz
Subject: Re: [ADMIN] since when has pg_stat_user_indexes.idx_scan been counting?
In-Reply-To: <4DCC4718.8000409@fuzzy.cz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox