| От | Raymond O'Donnell |
|---|---|
| Тема | Re: Is the primary key constraint also an index? |
| Дата | |
| Msg-id | 48A2AC4B.2050508@iol.ie обсуждение исходный текст |
| Ответ на | Is the primary key constraint also an index? ("Tim Uckun" <timuckun@gmail.com>) |
| Список | pgsql-general |
On 13/08/2008 03:18, Tim Uckun wrote: > If I have a primary key constraint defined in the database do I also > need to create an index on that field for fast lookup? As I understand it, creating a primary key on a table also creates an index automatically: testdb=# create table test(f1 integer, f2 text); CREATE TABLE testdb=# alter table test add constraint test_pk primary key(f1); NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index test_pk" for table "test" ALTER TABLE Ray. ------------------------------------------------------------------ Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland rod@iol.ie Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals ------------------------------------------------------------------
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера