Re: Optimizing away second VACUUM heap scan when only BRIN indexes on table

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: Optimizing away second VACUUM heap scan when only BRIN indexes on table
Дата
Msg-id 56775235.5090009@BlueTreble.com
обсуждение исходный текст
Ответ на Optimizing away second VACUUM heap scan when only BRIN indexes on table  (Peter Geoghegan <pg@heroku.com>)
Ответы Re: Optimizing away second VACUUM heap scan when only BRIN indexes on table  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On 11/23/15 5:06 PM, Peter Geoghegan wrote:
> I realize that the second scan performed by lazy_vacuum_heap() only
> visits those pages known to contain dead tuples. However, the
> experience of seeing problems with the random sampling of ANALYZE
> makes me think that that might not be very helpful. There is no good
> reason to think that there won't be a uniform distribution of dead
> tuples across the heap, and so only visiting pages known to contain
> dead tuples might be surprisingly little help even when there are
> relatively few VACUUM-able tuples in the table.

Even worse is if you can't fit all the dead TIDs in memory and have to 
do multiple passes for no reason...

> Has any thought been given to how we could make VACUUM avoid a second
> heap scan iff there are only BRIN indexes, without compromising
> anything else? In other words, by killing heap TIDs*before*  any
> "VACUUM" of BRIN index(es) occurs, avoiding a call to
> lazy_vacuum_heap(), just as when there are no indexes on the table
> whatsoever?

ISTM the big question here is how vacuum would know it can skip this 
since we wouldn't want to hard-code this for BRIN.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com



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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: Making tab-complete.c easier to maintain
Следующее
От: Amit Langote
Дата:
Сообщение: Re: Typo in the comment above heap_prepare_freeze_tuple()