Re: [PERFORM] is a good practice to create an index on the oid?

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: [PERFORM] is a good practice to create an index on the oid?
Дата
Msg-id 408DC9E1.8020704@familyhealth.com.au
обсуждение исходный текст
Ответ на is a good practice to create an index on the oid?  (Edoardo Ceccarelli <eddy@axa.it>)
Ответы Re: [JDBC] [PERFORM] is a good practice to create an index on the  (Dave Cramer <pg@fastcrypt.com>)
Список pgsql-admin
> I am using the oid of the table as the main key and I've found that is
> not indexed (maybe because I have declared another primary key in the
> table)
>
> it is a good practice to create an index like this on the oid of a table?
> CREATE INDEX idoid annuncio400 USING btree (oid);

Yes it is - in fact you really should add a unique index, not just a
normal index, as you want to enforce uniqueness of the oid column.  It
is theoretically possible to end up with duplicate oids in wraparound
situations.

Even better though is to not use oids at all, of course...

Chris


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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: [JDBC] is a good practice to create an index on the oid?
Следующее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: delete cascade question