Re: scan_recycle_buffers - Mailing list pgsql-patches

From Simon Riggs
Subject Re: scan_recycle_buffers
Date
Msg-id 1173477968.3641.360.camel@silverbirch.site
Whole thread Raw
In response to Re: scan_recycle_buffers  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: scan_recycle_buffers  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
On Fri, 2007-03-09 at 16:45 -0500, Tom Lane wrote:
> Heikki Linnakangas <heikki@enterprisedb.com> writes:
> > I wonder if calling RelationGetNumberOfBlocks on every seq scan becomes
> > a performance issue for tiny tables with for example just 1 page. It
> > performs an lseek, which isn't free.
>
> We do that anyway; but certainly Simon's patch ought not be injecting
> an additional one.

It should be possible to pass that down from the planner to the
executor, in certain cases. Or at least pass down the possibility that
such a check might be worthwhile.

Another approach might be to make the call after the first ~10 I/Os on a
SeqScan, after which an lseek will be just noise. That way an
all-in-cache scan would never need it at all. Thats easy to arrange
because the hint is invoked from the exec nodes themselves.

We probably need to get some measurements for the main benefit of the
patch before we look further into those thoughts.

--
  Simon Riggs
  EnterpriseDB   http://www.enterprisedb.com



pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: scan_recycle_buffers
Next
From: Tom Lane
Date:
Subject: Re: scan_recycle_buffers