Re: index scan on =, but not < ? - Mailing list pgsql-performance

From David Brown
Subject Re: index scan on =, but not < ?
Date
Msg-id 422F8F7F.2040505@bigpond.net.au
Whole thread Raw
In response to Re: index scan on =, but not < ?  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-performance
Assuming your system isn't starved for memory, shouldn't repeated page
fetches be hitting the cache?

I've also wondered about the conventional wisdom that read ahead doesn't
help random reads. I may well be missing something, but *if* the OS has
enough memory to cache most of the table, surely read ahead will still
work to your advantage?

Bruno Wolff III wrote:

>No. When you are doing an index scan of a significant part of the table,
>you will fetch some heap pages more than once. You will also be fetching
>blocks out of order, so you will lose out on read ahead optimization
>by the OS. This assumes that you don't get a lot of cache hits on the
>help pages. If a significant portion of the table is cached, then the
>trade off point will be at a higher percentage of the table.
>
>

pgsql-performance by date:

Previous
From: Russell Smith
Date:
Subject: Re: Help trying to tune query that executes 40x slower than in SqlServer
Next
From: David Brown
Date:
Subject: Re: index scan on =, but not < ?