Re: [PROPOSAL] Covering + unique indexes.

Поиск
Список
Период
Сортировка
От Teodor Sigaev
Тема Re: [PROPOSAL] Covering + unique indexes.
Дата
Msg-id 55F7B7C9.6090109@sigaev.ru
обсуждение исходный текст
Ответ на Re: [PROPOSAL] Covering + unique indexes.  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Ответы Re: [PROPOSAL] Covering + unique indexes.  (David Rowley <david.rowley@2ndquadrant.com>)
Список pgsql-hackers
> CREATE INDEX ... ON table (f1, f2, f3) UNIQUE(f1, f2) INCLUDE(f4);

I don't see an advantage this form. What is f3 column? just order? and 
f4 will not be used for compare?  At least now it requires additional 
checks that UNIQUE() fields are the same as first columns in definition. 
Non ordering field f4 will  require invasive intervention in planner 
because now it believes that all columns in btree are ordered.     

I agree, that form
CREATE UNIQUE INDEX i ON t (f1, f2, f3) INCLUDE (f4)
is clear. f4 will be used in row compare and actually planner will be 
able to use it as unique index (f1, f2, f3) with additional f4 or as
as unique index (f1, f2, f3, f4), because uniqueness on (f1, f2, f3) 
gives warranty of uniqueness on (f1, f2, f3, f4)



-- 
Teodor Sigaev                      E-mail: teodor@sigaev.ru                                      WWW:
http://www.sigaev.ru/



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

Предыдущее
От: Teodor Sigaev
Дата:
Сообщение: Re: Review: GiST support for UUIDs
Следующее
От: Teodor Sigaev
Дата:
Сообщение: Re: [PROPOSAL] Covering + unique indexes.