Re: Need indexes on inherited tables?

Поиск
Список
Период
Сортировка
От Phil Endecott
Тема Re: Need indexes on inherited tables?
Дата
Msg-id 8141987@chezphil.org
обсуждение исходный текст
Ответ на Re: Need indexes on inherited tables?  (Franco Bruno Borghesi <franco@akyasociados.com.ar>)
Ответы Re: Need indexes on inherited tables?
Re: Need indexes on inherited tables?
Список pgsql-sql
I asked if derived tables use primary key indexes generated in the base tables that they inherit from.

Franco Bruno Borghesi replied:
> [the derived table] is not inheriting any indexes, neither the
> primary key constraint.

OK, thanks!  I had come to the conclusion that it was not using the index, but I'm really surprised to hear that the
primarykey constraint that I define in a base table is not inherited.  Are any constraints inherited?  What happens if
Ideclare a single-column primary key?  What if I declare a "not null" constraint or a "check" constraint in a base
table?

Having to replicate the constraints and indexes for each derived table is a pain - lots of error-prone typing - but
thereis a more serious problem: how can I ensure that these keys are unique across all of the derived tables?  (i.e. if
T1and T2 inherit from B, and B's primary key is (id,xx), then I want there to be at most one row in (T1 union T2) that
hasany value of (id,xx).)
 

Is this a possible area for future enhancements?

Regards,

--Phil.



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

Предыдущее
От: Franco Bruno Borghesi
Дата:
Сообщение: Re: Need indexes on inherited tables?
Следующее
От: siganos@gmail.com (George Siganos)
Дата:
Сообщение: Re: Question about a CIDR based query