Re: visibility map and reltuples
От | Heikki Linnakangas |
---|---|
Тема | Re: visibility map and reltuples |
Дата | |
Msg-id | 4944EAC4.4070002@enterprisedb.com обсуждение исходный текст |
Ответ на | visibility map and reltuples ("Ned T. Crigler" <crigler@users.sourceforge.net>) |
Ответы |
Re: visibility map and reltuples
|
Список | pgsql-hackers |
Ned T. Crigler wrote: > It appears that the visibility map patch is causing pg_class.reltuples to be > set improperly after a vacuum. For example, it is set to 0 if the map > indicated that no pages in the heap needed to be scanned. > > Perhaps reltuples should not be updated unless every page was scanned during > the vacuum? Yeah, vacuum shouldn't overwrite reltuples if it hasn't scanned all pages. The interplay of vacuum and analyze in VACUUM ANALYZE needs to be changed too. Currently, the analyze after vacuum doesn't overwrite reltuples, because the one calculated by vacuum is based on scanning all pages, and is thus more accurate than the one estimated from the sample (which is not true anymore, as you pointed out). I think the vacuum needs to somehow tell analyze whether it updated reltuples or not, so that analyze can update reltuples if the vacuum didn't scan all pages. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com
В списке pgsql-hackers по дате отправления: