Re: Prereading using posix_fadvise (was Re: Commitfest patches)

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Prereading using posix_fadvise (was Re: Commitfest patches)
Дата
Msg-id 20080328155824.GD9150@svana.org
обсуждение исходный текст
Ответ на Re: Prereading using posix_fadvise (was Re: Commitfest patches)  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
On Fri, Mar 28, 2008 at 11:41:58AM -0400, Bruce Momjian wrote:
> Should we consider only telling the kernel X pages ahead, meaning when
> we are on page 10 we tell it about page 16?

It's not so interesting for sequential reads, the kernel can work that
out for itself. Disk reads are usually in blocks of at least 128K
anyway, so there's a real good chance you have block 16 already.

The interesting case is index scan, where you so a posix_fadvise() on
the next block *before* returning the items in the current block. Then
by the time you've processed these tuples, the next block will
hopefully have been read in and we can proceed without delay.

Or fadvising all the tuples referred to from an index page at once so
the kernel can determine the optimal order to fetch them. The read()
will still be in order of the tuple, but the delay will (hopefully) be
less.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Commitfest patches
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Prereading using posix_fadvise (was Re: Commitfest patches)