Re: Domain check taking place unnecessarily?

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

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.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Benjamin Tingle 2023-02-09 17:40:48 Re: Window Functions & Table Partitions
Previous Message Mark Hills 2023-02-09 11:01:41 Re: Domain check taking place unnecessarily?