Re: An idle thought

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Gokulakannan Somasundaram <gokul007(at)gmail(dot)com>, Greg Stark <stark(at)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: An idle thought
Date: 2010-03-18 22:02:31
Message-ID: 1268949751.4053.543.camel@monkey-cat.sm.truviso.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2010-03-18 at 14:48 -0700, Jeff Davis wrote:
> On Thu, 2010-03-18 at 17:17 -0400, Tom Lane wrote:
> > > The VM cause wrong results if a bit is set that's not supposed to be --
> > > right? Am I missing something? How does a seq scan skip visibility
> > > checks and still produce right results, if it doesn't rely on the bit?
> >
> > It doesn't. The only thing we currently rely on the VM for is deciding
> > whether a page needs vacuuming
>
> Oh, my mistake. I misremembered the discussion and I thought the seq
> scan optimization made it in.
>

Hmm...

>From heapgetpage() in heapam.c, CVS HEAD:
/*
* If the all-visible flag indicates that all tuples on the page
are
* visible to everyone, we can skip the per-tuple visibility tests.
But

I tested in gdb, and it calls HeapTupleSatisfiesMVCC, until I VACUUM a
few times, and then it doesn't call it any more. So, apparently the seq
scan optimization _is_ there. And that means it is correctness-critical.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-03-18 23:00:43 Re: An idle thought
Previous Message Jeff Davis 2010-03-18 21:48:39 Re: An idle thought