Re: Vacuuming anything zeroes shared table stats

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Vacuuming anything zeroes shared table stats
Дата
Msg-id 11916.1181230916@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Vacuuming anything zeroes shared table stats  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: Vacuuming anything zeroes shared table stats  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> The problem is that the database hash is cleared of databases that no
> longer exist, and the database list is constructed by scanning
> pg_database.  Since no entry exist for the database we use for shared
> tables (InvalidOid), the hash table is dropped.

Doh ...

> The attached patch fixes this.

Wouldn't it be easier to just special-case the shared DB in
pgstat_vacuum_tabstat?
   while ((dbentry = (PgStat_StatDBEntry *) hash_seq_search(&hstat)) != NULL)   {       Oid            dbid =
dbentry->databaseid;
       CHECK_FOR_INTERRUPTS();

-       if (hash_search(htab, (void *) &dbid, HASH_FIND, NULL) == NULL)
+       /* ignore the DB entry for shared tables ... they never go away */
+       if (OidIsValid(dbid) &&
+           hash_search(htab, (void *) &dbid, HASH_FIND, NULL) == NULL)           pgstat_drop_database(dbid);   }


>> Additionally, in 8.3devel doing anything that queries or modifies a
>> shared table seems to zero the statistics for all shared tables.

> I'm not sure if this is fixed by the patch; can you verify, or provide a
> more specific description of the problem?

Seems unlikely that this bug would explain a behavior like that.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Vacuuming anything zeroes shared table stats
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Create a GUC parametertemp_tablespacesthat allows selection of