Re: R: [GENERAL] Slow queries on very big (and partitioned) table - Mailing list pgsql-general

From Steven Winfield
Subject Re: R: [GENERAL] Slow queries on very big (and partitioned) table
Date
Msg-id E9FA92C2921F31408041863B74EE4C20016CDF1396@CCPMAILDAG03.cantab.local
Whole thread Raw
In response to Re: R: [GENERAL] Slow queries on very big (and partitioned) table  (Stephen Frost <sfrost@snowman.net>)
List pgsql-general
> Unfortunately, that'll require locking each table and scanning it to make sure that the CHECK constraint isn't
violated.

Actually, CHECK constraints can be added with the NOT VALID clause.
New tuples will be checked immediately, while the validation of existing tuples can be done later using ALTER TABLE ...
VALIDATECONSTRAINT ... which takes a less invasive lock than if you'd omitted NOT VALID. 

Steve.



pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: R: [GENERAL] Slow queries on very big (and partitioned) table
Next
From: John R Pierce
Date:
Subject: Re: [GENERAL] Slow queries on very big (and partitioned) table