Re: indexes on primary and foreign keys

Поиск
Список
Период
Сортировка
От K C Lau
Тема Re: indexes on primary and foreign keys
Дата
Msg-id 6.2.1.2.0.20060112103712.0529cdd0@localhost
обсуждение исходный текст
Ответ на Re: indexes on primary and foreign keys  (Michael Glaesemann <grzm@myrealbox.com>)
Ответы Re: indexes on primary and foreign keys
Список pgsql-performance
At 09:26 06/01/12, you wrote:

>On Jan 12, 2006, at 9:36 , K C Lau wrote:
>
>>>NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
>>>"cities_pkey" for table "cities"
>>
>>Is there a way to suppress this notice when I create tables in a
>>script?
>
>Set[1] your log_min_messages to WARNING or higher[2].
>
>[1](http://www.postgresql.org/docs/current/interactive/sql-set.html)
>[2](http://www.postgresql.org/docs/current/interactive/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHEN)
>
>Michael Glaesemann
>grzm myrealbox com

Thanks. The side effect is that it would suppress other notices which might
be useful.

I was looking for a way to suppress the notice within the CREATE TABLE
statement but could not.
I noticed that when I specify a constraint name for the primary key, it
would create an implicit index with the constraint name. So may be if the
optional constraint name is specified by the user, then the notice can be
suppressed. Indeed the manual already says that the index will be
automatically created.

BTW, there's an extra space in link[2] above which I have removed.

Best regards,
KC.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Extremely irregular query performance
Следующее
От: Robert Creager
Дата:
Сообщение: Re: Index isn't used during a join.