Search Postgresql Archives

Are indices used for creating check constraints?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 resolved by answer from David Rowley)


I tried various kind of indices to optimize 2. but nothing helps. When creating check constraint on column values directly is very fast (seems analyze helps), but creating check constraint on _expression_ is very slow, even twice as long as creating index on the same _expression_. 


Is it possible to use indices to create check expressions?

Why is 2. twice as long as 1.?

Why is 3. twice as long as 2.? (when there is no appropriate check constraint for 3.)


Thank you,

Dinko


Sent from Outlook


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux