Alvaro Herrera <[EMAIL PROTECTED]> 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 stats collector 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



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to