Re: Get the offset of a tuple inside a table - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Get the offset of a tuple inside a table
Date
Msg-id 13464.1285119132@sss.pgh.pa.us
Whole thread Raw
In response to Re: Get the offset of a tuple inside a table  (Pei He <hepeimail@gmail.com>)
Responses Re: Get the offset of a tuple inside a table
List pgsql-hackers
Pei He <hepeimail@gmail.com> writes:
> What I want to do is, for a given key return the tuples that Index scan can
> find, and return the rest tuples by a seq scan. So, I need to know which
> tuples have been returned by maintain a bitmap, and to avoid return the same
> tuple twice.

> If I can know the offset of a tuple in the order of file scan, then I can
> force the seq scan to skip it.

As pointed out, "offset" is an unworkable concept here.  That's why the
tidbitmap code doesn't work with offsets; it works with tids.  You don't
really need to reinvent this wheel.  Go read the bitmapscan code.

(One wonders though what you think you are going to save if you have to
do a seqscan anyway.  Where's the advantage over just doing a seqscan?)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Multi-branch committing in git, revisited
Next
From: KaiGai Kohei
Date:
Subject: Re: ALTER TYPE extensions