Re: ice-broker scan thread

From: "Pollard, Mike" <mpollard(at)cincom(dot)com>
To: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>
Cc: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ice-broker scan thread
Date: 2005-11-29 15:11:41
Message-ID: 6418CC03D0FB1943A464E1FEFB3ED46B01B220E8@im01.cincom.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

No, I only go x number of pages ahead of the user scan (where x is
currently user defined, but it should be significantly smaller than your
number of data buffers). I have found that reading about 16Mb ahead
gives optimal performance, and on modern machines isn't all that much
memory. Once the user scan has processed most of that 16Mb, the next
section of the tree is schedule to be read. I don't keep the read ahead
threads a constant distance ahead, because I found it to be more
efficient if they occasionally had a lot of pages to read at once,
rather than constantly having a few pages to read.

Mike Pollard
SUPRA Server SQL Engineering and Support
Cincom Systems, Inc.
--------------------------------
Better to remain silent and be thought a fool than to speak out and
remove all doubt.
Abraham Lincoln

-----Original Message-----
From: Martijn van Oosterhout [mailto:kleptog(at)svana(dot)org]
Sent: Tuesday, November 29, 2005 10:06 AM
To: Pollard, Mike
Cc: Qingqing Zhou; pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] ice-broker scan thread

On Tue, Nov 29, 2005 at 09:45:30AM -0500, Pollard, Mike wrote:
> Anyway, what I did was the following. When doing a sequential scan,
we
> were starting at the beginning of the table and scanning forward. If
I
> threw up some threads to read ahead, then my user thread and my read
> ahead threads would thrash on trying to lock the buffer slots. So, I

<snip>

> so above, the user threads is starting low in the table and working
> high; the readahead threads are starting higher (but not at the end of
> the table), and working low.

Ok, this may be a really dumb question, but doesn't this rely on the
fact that the table is smaller than the amount of buffers? If the table
is large most of your data will be tossed out again by later data
before it's been used by the backend.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is
a
> tool for doing 5% of the work and then sitting around waiting for
someone
> else to do the other 95% so you can sue them.

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Piskorski 2005-11-29 15:22:56 Re: ice-broker scan thread
Previous Message Martijn van Oosterhout 2005-11-29 15:06:18 Re: ice-broker scan thread