Re: R: Slow queries on very big (and partitioned) table

From: Steven Winfield <Steven(dot)Winfield(at)cantabcapital(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>, Job <Job(at)colliniconsulting(dot)it>
Cc: Jaime Soler <jaime(dot)soler(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: R: Slow queries on very big (and partitioned) table
Date: 2017-02-20 15:02:21
Message-ID: E9FA92C2921F31408041863B74EE4C20016CDF1396@CCPMAILDAG03.cantab.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 ... VALIDATE CONSTRAINT ... which takes a less invasive lock than if you'd omitted NOT VALID.

Steve.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2017-02-20 17:23:48 Re: Slow queries on very big (and partitioned) table
Previous Message Stephen Frost 2017-02-20 14:49:59 Re: R: Slow queries on very big (and partitioned) table