Re: Turning off HOT/Cleanup sometimes

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Turning off HOT/Cleanup sometimes
Дата
Msg-id 20150420221338.GY4369@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Turning off HOT/Cleanup sometimes  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Turning off HOT/Cleanup sometimes  (Bruce Momjian <bruce@momjian.us>)
Re: Turning off HOT/Cleanup sometimes  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Bruce Momjian wrote:
> On Mon, Apr 20, 2015 at 04:19:22PM -0300, Alvaro Herrera wrote:
> > Bruce Momjian wrote:
> > 
> > This seems simple to implement: keep two counters, where the second one
> > is pages we skipped cleanup in.  Once that counter hits SOME_MAX_VALUE,
> > reset the first counter so that further 5 pages will get HOT pruned.  5%
> > seems a bit high though.  (In Simon's design, SOME_MAX_VALUE is
> > essentially +infinity.)
> 
> This would tend to dirty non-sequential heap pages --- it seems best to
> just clean as many as we are supposed to, then skip the rest, so we can
> write sequential dirty pages to storage.

Keep in mind there's a disconnect between dirtying a page and writing it
to storage.  A page could remain dirty for a long time in the buffer
cache.  This writing of sequential pages would occur at checkpoint time
only, which seems the wrong thing to optimize.  If some other process
needs to evict pages to make room to read some other page in, surely
it's going to try one page at a time, not write "many sequential dirty
pages."

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: Freeze avoidance of very large table.
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: parallel mode and parallel contexts