Composite keys

Поиск
Список
Период
Сортировка
От Carlo Stonebanks
Тема Composite keys
Дата
Msg-id CCB4B01D184042ECBBE456D1ACB185A4@CAPRICA
обсуждение исходный текст
Ответы Re: Composite keys  (Claudio Freire <klaussfreire@gmail.com>)
Список pgsql-performance

Excuse the noob question, I couldn’t find any reading material on this topic.

 

Let’s say my_table has two fields, pkey_id and another_id. The primary key is pkey_id and of course indexed.

 

Then someone adds a composite index on btree(pkey_id, another_id).

 

Question 1) Is there any benefit to having pkey_id in the second index (assuming the index was created to satisfy some arbitrary WHERE clause)?

 

Question 2) Regardless of the answer to Question 1 - if another_id is not guaranteed to be unique, whereas pkey_id is – there any value to changing the order of declaration (more generally, is there a performance impact for column ordering in btree composite keys?)

 

Thanks,

 

Carlo

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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: postgresql query runtime
Следующее
От: bricklen
Дата:
Сообщение: Re: Rapidly finding maximal rows