diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index f686416a67c..87c51578c7c 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -13,7 +13,7 @@ * * Copyright (c) 2001-2006, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.140.2.4 2007/06/07 19:07:13 alvherre Exp $ + * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.140.2.5 2007/07/08 22:23:25 tgl Exp $ * ---------- */ #include "postgres.h" @@ -841,8 +841,12 @@ pgstat_drop_database(Oid databaseid) * Tell the collector that we just dropped a relation. * (If the message gets lost, we will still clean the dead entry eventually * via future invocations of pgstat_vacuum_tabstat().) + * + * Currently not used for lack of any good place to call it; we rely + * entirely on pgstat_vacuum_tabstat() to clean out stats for dead rels. * ---------- */ +#ifdef NOT_USED void pgstat_drop_relation(Oid relid) { @@ -861,6 +865,7 @@ pgstat_drop_relation(Oid relid) msg.m_databaseid = MyDatabaseId; pgstat_send(&msg, len); } +#endif /* NOT_USED */ /* ---------- diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c index 0ceb800b363..3d4f5b5ccd8 100644 --- a/src/backend/storage/smgr/smgr.c +++ b/src/backend/storage/smgr/smgr.c @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.101 2006/10/04 00:29:58 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.101.2.1 2007/07/08 22:23:25 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -20,11 +20,11 @@ #include "access/xact.h" #include "access/xlogutils.h" #include "commands/tablespace.h" -#include "pgstat.h" #include "storage/bufmgr.h" #include "storage/freespace.h" #include "storage/ipc.h" #include "storage/smgr.h" +#include "utils/hsearch.h" #include "utils/memutils.h" @@ -471,13 +471,11 @@ smgr_internal_unlink(RelFileNode rnode, int which, bool isTemp, bool isRedo) FreeSpaceMapForgetRel(&rnode); /* - * 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). + * It'd be nice to tell the stats collector to forget it immediately, too. + * But we can't because we don't know the OID (and in cases involving + * relfilenode swaps, it's not always clear which table OID to forget, + * anyway). */ - if (!InRecovery) - pgstat_drop_relation(rnode.relNode); /* * And delete the physical files. diff --git a/src/include/pgstat.h b/src/include/pgstat.h index 8f5db770795..65145d5944f 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -5,7 +5,7 @@ * * Copyright (c) 2001-2006, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.50 2006/10/04 00:30:06 momjian Exp $ + * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.50.2.1 2007/07/08 22:23:25 tgl Exp $ * ---------- */ #ifndef PGSTAT_H @@ -377,7 +377,6 @@ extern void pgstat_ping(void); extern void pgstat_report_tabstat(void); extern void pgstat_vacuum_tabstat(void); -extern void pgstat_drop_relation(Oid relid); extern void pgstat_reset_counters(void);