Re: Are indices used for creating check constraints?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Are indices used for creating check constraints?
Дата
Msg-id 83722.1540231938@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Are indices used for creating check constraints?  (Dinko Papak <rimokatolik@outlook.com>)
Список pgsql-general
Dinko Papak <rimokatolik@outlook.com> writes:
> Here are 3 interesting (to me) numbers:
> 1. creating index on expression (func(timestamp)) takes 5 seconds
> 2. creating check constraint on the same expression takes 10 seconds
> 3. adding partition table based on the same expression without check expression takes 20 seconds (this has been
resolvedby answer from David Rowley) 

Hmm ...

> Is it possible to use indices to create check expressions?

No.

> Why is 2. twice as long as 1.?

Good question.  Could you provide a concrete test case?

            regards, tom lane


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

Предыдущее
От: Dinko Papak
Дата:
Сообщение: Are indices used for creating check constraints?
Следующее
От: Boris Sagadin
Дата:
Сообщение: Re: Postgres 10, slave not catching up with master