Alvaro Herrera <alvherre@commandprompt.com> wrote:
> Something worth considering, though unrelated to the topic at hand: what
> happens with the table stats after CLUSTER? Should we cause an ANALYZE
> afterwards? We could end up running with outdated statistics.
We don't invalidate the value statistics in pg_stats by ANALYZE presently.
Also, the runtime statistics are not invalidated -- it cound be a bug.
pgstat_drop_relation() is expecting relid (pg_class.oid) as the argument,
but we pass it relfilenode.
[storage/smgr/smgr.c]
static void
smgr_internal_unlink(RelFileNode rnode, int which, bool isTemp, bool isRedo)
{ ... /* * Tell the stats collector to forget it immediately, too. Skip this in * recovery mode, since the
statscollector likely isn't running (and if * it is, pgstat.c will get confused because we aren't a real backend
*process). */ if (!InRecovery) pgstat_drop_relation(rnode.relNode);
...
}
Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center