Re: visibility map and reltuples

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: visibility map and reltuples
Дата
Msg-id 49461CE8.4050007@enterprisedb.com
обсуждение исходный текст
Ответ на Re: visibility map and reltuples  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: visibility map and reltuples  (Greg Stark <greg.stark@enterprisedb.com>)
Список pgsql-hackers
Heikki Linnakangas wrote:
> 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.

Because we use reltuples divided by relpages in the planner, we probably 
shouldn't update relpages either if we don't update reltuples. 
Otherwise, if the table has grown a lot since we last updated reltuples, 
the reltuples / relpages ratio would be less, not more, accurate, if 
relpages is updated to a new higher value but reltuples is not.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Sync Rep: First Thoughts on Code
Следующее
От: "Rushabh Lathia"
Дата:
Сообщение: Function with defval returns error