Re: our buffer replacement strategy is kind of lame

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: our buffer replacement strategy is kind of lame
Дата
Msg-id CAM-w4HNOC7qV1X3T2JwBkeYrXCr0d6H4KdO7SUAOEo9JLus5vg@mail.gmail.com
обсуждение исходный текст
Ответ на our buffer replacement strategy is kind of lame  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: our buffer replacement strategy is kind of lame  (Robert Haas <robertmhaas@gmail.com>)
Re: our buffer replacement strategy is kind of lame  (Greg Smith <greg@2ndQuadrant.com>)
Список pgsql-hackers
On Fri, Aug 12, 2011 at 5:05 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> Only 96 of the 14286 buffers in sample_data are in shared_buffers,
> despite the fact that we have 37,218 *completely unused* buffers lying
> around.  That sucks, because it means that the sample query did a
> whole lot of buffer eviction that was completely needless.  The ring
> buffer is there to prevent trashing the shared buffer arena, but here
> it would have been fine to trash the arena: there wasn't anything
> there we would have minded losing (or, indeed, anything at all).

I don't disagree with the general thrust of your point, but I just
wanted to point out one case where not using free buffers even though
they're available might make sense:

If you execute a large batch delete or update or even just set lots of
hint bits you'll dirty a lot of buffers. The ring buffer forces the
query that is actually dirtying all these buffers to also do the i/o
to write them out. Otherwise you leave them behind to slow down other
queries. This was one of the problems with the old vacuum code which
the ring buffer replaced. It left behind lots of dirtied buffers for
other queries to do i/o on.

--
greg


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

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: PL/Perl Returned Array
Следующее
От: Darren Duncan
Дата:
Сообщение: Re: PL/Perl Returned Array