Re: Domain check taking place unnecessarily?

From: Mark Hills <mark(at)xwax(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Domain check taking place unnecessarily?
Date: 2023-02-10 10:49:25
Message-ID: 2302101040520.20262@stax.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, 9 Feb 2023, Tom Lane wrote:

> Mark Hills <mark(at)xwax(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Adithya Kumaranchath 2023-02-10 18:53:09 For loop execution times in PostgreSQL 12 vs 15
Previous Message Benjamin Tingle 2023-02-09 17:40:48 Re: Window Functions & Table Partitions