Re: Using oids

Поиск
Список
Период
Сортировка
От Bo Lorentsen
Тема Re: Using oids
Дата
Msg-id 1062606201.7851.151.camel@localhost
обсуждение исходный текст
Ответ на Re: Using oids  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
On Wed, 2003-09-03 at 17:28, Martijn van Oosterhout wrote:

> If you know the OID of a row, PostgreSQL doesn't have a special lookup table
> to find it. That's also why they're not unique; the backend would have to
> scan through every table to find out if the next one is available.
Ahh, thats not nice, hav'nt checked that, yet.

> So, unless you specifically add an index to the table, looking up by OID
> will always trigger a sequential scan.
I thought it was much more easy for PG to find these, but I quess ctid
are the one that is fast to find.

> That said, there is no reason why someone couldn't create a last_sequence()
> function so you could say SELECT currval( last_sequence() ). Ofcourse, if
> your table has no SERIAL field, you're stuffed either way.
Not as nice as oid's.

/BL


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

Предыдущее
От: Josué Maldonado
Дата:
Сообщение: Access to an element of array NEW in TCL
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: What is the good equivalent for ENUM ?