Re: Vacuum statistics
От | Alena Rybakina |
---|---|
Тема | Re: Vacuum statistics |
Дата | |
Msg-id | d711fa74-18c5-4e6b-94e9-714892aea01a@postgrespro.ru обсуждение исходный текст |
Ответ на | Vacuum statistics (Alena Rybakina <lena.ribackina@yandex.ru>) |
Список | pgsql-hackers |
On 22.08.2024 05:47, jian he wrote:
On Wed, Aug 21, 2024 at 6:37 AM Alena Rybakina <a.rybakina@postgrespro.ru> wrote:We check it there: "tabentry->vacuum_ext.type != type". Or were you talking about something else? On 19.08.2024 12:32, jian he wrote: in pg_stats_vacuum if (type == PGSTAT_EXTVAC_INDEX || type == PGSTAT_EXTVAC_HEAP) { Oid relid = PG_GETARG_OID(1); /* Load table statistics for specified database. */ if (OidIsValid(relid)) { tabentry = fetch_dbstat_tabentry(dbid, relid); if (tabentry == NULL || tabentry->vacuum_ext.type != type) /* Table don't exists or isn't an heap relation. */ PG_RETURN_NULL(); tuplestore_put_for_relation(relid, rsinfo, tabentry); } else { } So for functions pg_stat_vacuum_indexes and pg_stat_vacuum_tables, it seems you didn't check "relid" 's relkind, you may need to use get_rel_relkind. --hi. I mentioned some points at [1], Please check the attached patchset to address these issues.
Thank you for your work! I checked the patches and added your suggested changes to the new version of the patch here [0]. In my opinion, nothing was missing, but please take a look.
[0] https://www.postgresql.org/message-id/c4e4e305-7119-4183-b49a-d7092f4efba3%40postgrespro.ru
there are four occurrences of "CurrentDatabaseId", i am still confused with usage of CurrentDatabaseId.
It needed to be used because of scanning objects from the other database, so we change the id of dbid temporary to achieve it.
You should snow that every part of this code was deleted. Now we can check information about tables and indexes from the current database.
Ok, no problem.also please don't top-post, otherwise the archive, like [2] is not easier to read for future readers. generally you quote first, then reply. [1] https://postgr.es/m/CACJufxHb_YGCp=pVH6DZcpk9yML+SueffPeaRbX2LzXZVahd_w@mail.gmail.com [2] https://postgr.es/m/78394e29-a900-4af4-b5ce-d6eb2d263fad@postgrespro.ru
-- Regards, Alena Rybakina Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
В списке pgsql-hackers по дате отправления: