Re: DROP TABLE and autovacuum

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: DROP TABLE and autovacuum
Date: 2007-06-21 03:27:22
Message-ID: 20070621115823.6E6B.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Alvaro Herrera <alvherre(at)commandprompt(dot)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 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ITAGAKI Takahiro 2007-06-21 04:56:56 autovacuum launcher continues to run after reloading autovacuum=off
Previous Message Jaime Casanova 2007-06-21 03:10:59 month abreviation

Browse pgsql-patches by date

  From Date Subject
Next Message Heikki Linnakangas 2007-06-21 08:14:54 Re: Load Distributed Checkpoints, take 3
Previous Message ITAGAKI Takahiro 2007-06-21 01:40:42 Re: Load Distributed Checkpoints, take 3