Re: [HACKERS] Regarding B-Tree Lookup

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [HACKERS] Regarding B-Tree Lookup
Дата
Msg-id CAB7nPqQsDsv=y3gxoeMK0s68-Rb2w__3CA+0iC6esOWmzXB+JA@mail.gmail.com
обсуждение исходный текст
Ответ на [HACKERS] Regarding B-Tree Lookup  (Mahi Gurram <teckymahi@gmail.com>)
Ответы Re: [HACKERS] Regarding B-Tree Lookup  (Craig Ringer <craig.ringer@2ndquadrant.com>)
Re: [HACKERS] Regarding B-Tree Lookup  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, May 2, 2017 at 6:12 PM, Mahi Gurram <teckymahi@gmail.com> wrote:
> I'm building some custom extension on top of postgres 9.6.1. As part of
> that, I would like to read Heap Tuple directly from my extension using
> Primary Key.
>
> By default, postgres table index(B-Tree) its PrimaryKey(PK). So, i would
> like to get TID by doing a lookup into PK's B-Tree index. Using which i
> could read HeapTuple directly.
>
> Please suggest me the easiest way to lookup into PK's B-Tree index for
> getting TIDs.

Why don't you just use SPI within your extension? No need to copy the
logic for btree lookups this way.
https://www.postgresql.org/docs/9.6/static/spi.html

> Suggesting a postgres extensions which does B-Tree lookup will also helps
> me.

contrib/amcheck looks at raw btree data, though I am not sure that you
actually need to go down to that. But that's hard to reach a
conclusion without more details.
-- 
Michael



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] [Proposal]: Extends VisualStudio to automaticallyprecompile EmbeddedSQL
Следующее
От: hariprasath nallasamy
Дата:
Сообщение: [HACKERS] Shared Memory hash tables only at startup