Re: Get the offset of a tuple inside a table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Get the offset of a tuple inside a table
Дата
Msg-id 13464.1285119132@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Get the offset of a tuple inside a table  (Pei He <hepeimail@gmail.com>)
Ответы Re: Get the offset of a tuple inside a table
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Multi-branch committing in git, revisited
Следующее
От: KaiGai Kohei
Дата:
Сообщение: Re: ALTER TYPE extensions