Re: Get the offset of a tuple inside a table

Поиск
Список
Период
Сортировка
От Pei He
Тема Re: Get the offset of a tuple inside a table
Дата
Msg-id AANLkTinzKoTUKEJhYgOSPjuamxKNwcz+mJzOu2Z4x3cx@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Get the offset of a tuple inside a table  (Szymon Guz <mabewlun@gmail.com>)
Ответы Re: Get the offset of a tuple inside a table  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi Szymon, Kevin,
The offset is the order of a tuple in a Sequential Scan.

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.

By ctid, can I know how much tuples are in a block, is it an constant?

I think a more general solution would be build a hash table on ctid.
What do you think?

Thanks
--
Pei


On Tue, Sep 21, 2010 at 5:44 PM, Szymon Guz <mabewlun@gmail.com> wrote:


On 21 September 2010 23:02, Pei He <hepeimail@gmail.com> wrote:
Hi,
When I using an index scan, can I get the offset of the tuple in the table?

Thanks
--
Pei

What do you mean by "the offset in the table"?

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Configuring synchronous replication
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Get the offset of a tuple inside a table