On Fri, 2007-03-09 at 16:45 -0500, Tom Lane wrote:
> Heikki Linnakangas <[EMAIL PROTECTED]> 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



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to