Re: scan_recycle_buffers

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: scan_recycle_buffers
Date: 2007-03-09 22:06:07
Message-ID: 1173477968.3641.360.camel@silverbirch.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Fri, 2007-03-09 at 16:45 -0500, Tom Lane wrote:
> Heikki Linnakangas <heikki(at)enterprisedb(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2007-03-09 22:16:20 Re: Auto creation of Partitions
Previous Message Tom Lane 2007-03-09 21:45:40 Re: scan_recycle_buffers

Browse pgsql-patches by date

  From Date Subject
Next Message Hannu Krosing 2007-03-09 22:16:20 Re: Auto creation of Partitions
Previous Message Tom Lane 2007-03-09 21:45:40 Re: scan_recycle_buffers