Re: Efficiently query for the most recent record for a given user

Поиск
Список
Период
Сортировка
От Claudio Freire
Тема Re: Efficiently query for the most recent record for a given user
Дата
Msg-id CAGTBQpb7qmmj-TZ+Q4AJ3ToEfTogJ6dRVYnGcRSfSbT4pEFbJw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Efficiently query for the most recent record for a given user  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
On Wed, Aug 7, 2013 at 4:04 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Yeah, but it's faster if it's in the same direction, because the
>> kernel read-ahead code detects sequential reads, whereas it doesn't
>> when it goes backwards. The difference can be up to a factor of 10 for
>> long index scans.
>
> Color me skeptical.  Index searches are seldom purely sequential block
> accesses.  Maybe if you had a freshly built index that'd never yet
> suffered any inserts/updates, but in practice any advantage would
> disappear very quickly after a few index page splits.

Maybe.

I've tested on pgbench test databases, which I'm not sure whether
they're freshly built indexes or incrementally built ones, and it
applies there (in fact backward index-only scans was one of the
workloads the read-ahead patch improved the most).


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Efficiently query for the most recent record for a given user
Следующее
От:
Дата:
Сообщение: Re: [PERFORM] RE: [PERFORM] Re: [PERFORM] Sub-optimal plan for a paginated query on a view with another view inside of it.