Re: Memory prefetching while sequentially fetching from SortTuple array, tuplestore - Mailing list pgsql-hackers

From David Rowley
Subject Re: Memory prefetching while sequentially fetching from SortTuple array, tuplestore
Date
Msg-id CAKJS1f8aMfbVTrcx5Uj-3fPueA+Mff-BMqrV75R_=eCpvcPqvQ@mail.gmail.com
Whole thread Raw
In response to Re: Memory prefetching while sequentially fetching from SortTuple array, tuplestore  (Peter Geoghegan <pg@heroku.com>)
Responses Re: Memory prefetching while sequentially fetching from SortTuple array, tuplestore  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
On 3 September 2015 at 07:24, Peter Geoghegan <pg@heroku.com> wrote:
On Wed, Sep 2, 2015 at 7:12 AM, Andres Freund <andres@anarazel.de> wrote:
> What worries me about adding explicit prefetching is that it's *highly*
> platform and even micro-architecture dependent. Why is looking three
> elements ahead the right value?

Because that was the fastest value following testing on my laptop. You
are absolutely right to point out that this isn't a good reason to go
with the patch -- I share your concern. All I can say in defense of
that is that other major system software does the same, without any
regard for the underlying microarchitecture AFAICT. So, yes,
certainly, more testing is required across a reasonable cross-section
of platforms to justify the patch. 

FWIW someone else found 3 to be good on the platform they tested on:

Peter, would you be able to share the test case which you saw the speedup on. So far I've been unable to see much of an improvement.

Regards

David Rowley

--
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
 

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: WIP: Make timestamptz_out less slow.
Next
From: Peter Geoghegan
Date:
Subject: Re: Memory prefetching while sequentially fetching from SortTuple array, tuplestore