pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Hills <mark@xwax.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Domain check taking place unnecessarily?
Date: Fri, 10 Feb 2023 10:49:25 +0000 (GMT)
Message-ID: <2302101040520.20262@stax.localdomain> (raw)
In-Reply-To: <3893890.1675955401@sss.pgh.pa.us>
References: <2302081605290.5352@stax.localdomain>
	<4b1a0c9e36280b1d4abeb4fb6336832409df6ae0.camel@cybertec.at>
	<2302091035450.14632@stax.localdomain>
	<3893890.1675955401@sss.pgh.pa.us>

On Thu, 9 Feb 2023, Tom Lane wrote:

> Mark Hills <mark@xwax.org> writes:
> > On Wed, 8 Feb 2023, Laurenz Albe wrote:
> >> It takes 30 seconds to schan the table and determine that all existing 
> >> rows satisky the constraint.
> 
> > But there's no existing data (note this is adding column, not constraint)
> 
> > Existing rows are guaranteed to satisfy the domain check, because the 
> > domain check is guaranteed to be immutable (per [1] in my original mail)
> 
> immutable != "will accept null".
> 
> There could be some more optimizations here, perhaps, but there aren't.

Well that's no problem at all. Thanks for the clarification.

I mentioned this case to a few people and they were also surprised by the 
outcome, to the point where we wondered if this might be misbehaving. 
Hence bringing it up in this forum.

We'll go ahead and deal with the pauses in production, as I don't think 
there's a workaround.

Thanks

-- 
Mark





view thread (7+ messages)

Message-ID: <2302101040520.20262@stax.localdomain>
Permalink:  ../2302101040520.20262@stax.localdomain/
Also on:    postgresql.org/message-id/2302101040520.20262@stax.localdomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: mark@xwax.org, tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, pgsql-performance@lists.postgresql.org
  Subject: Re: Domain check taking place unnecessarily?
  In-Reply-To: <2302101040520.20262@stax.localdomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox