Add primary key/unique constraint using prefix columns of an index

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Add primary key/unique constraint using prefix columns of an index
Дата
Msg-id CAMkU=1w53p2mgOabWcVOzemBXUkmEJjg67gVosNE9JZ9bxOi2A@mail.gmail.com
обсуждение исходный текст
Ответы Re: Add primary key/unique constraint using prefix columns of an index  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Add primary key/unique constraint using prefix columns of an index  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Add primary key/unique constraint using prefix columns of an index  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
Now that there are index only scans, there is a use case for having a
composite index which has the primary key or a unique key as the
prefix column(s) but with extra columns after that.  Currently you
would also need another index with exactly the primary/unique key,
which seems like a waste of storage and maintenance.

Should there be a way to declare a "unique" index with the unique
property applying to a prefix of the indexed columns/expression?  And
having that, a way to turn that prefix into a primary key constraint?

Of course this is easier said then done, but is there some reason for
it not to be a to-do item?

Thanks,

Jeff


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Changing the concept of a DATABASE
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Changing the concept of a DATABASE