Re: Domain check taking place unnecessarily?

2023-02-09 Thread Mark Hills
On Wed, 8 Feb 2023, Laurenz Albe wrote: > On Wed, 2023-02-08 at 18:01 +, Mark Hills wrote: > > I've ruled out waiting on a lock; nothing is reported with > > log_lock_waits=on. This is a test database with exclusive access (2.5 > > million rows): > > > > This is PostgreSQL 14.5 on Alpine Li

Re: Domain check taking place unnecessarily?

2023-02-09 Thread Mark Hills
On Wed, 8 Feb 2023, David G. Johnston wrote: > On Wed, Feb 8, 2023 at 11:01 AM Mark Hills wrote: > > > > > CREATE DOMAIN hash AS text > > CHECK (VALUE ~ E'^[a-zA-Z0-9]{8,32}$'); > > > > devstats=> ALTER TABLE invite ADD COLUMN test hash; > > ALTER TABLE > > Time: 30923.380 ms (00:30.923) > >

Re: Domain check taking place unnecessarily?

2023-02-09 Thread Tom Lane
Mark Hills 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

Re: Window Functions & Table Partitions

2023-02-09 Thread Benjamin Tingle
Thanks for the helpful response david! I'll have a shot at getting the patch to work myself & submitting to pgsql-hackers. Ben On Wed, Feb 8, 2023 at 2:36 PM David Rowley wrote: > On Thu, 9 Feb 2023 at 10:45, Benjamin Tingle wrote: > > Basically- window partition functions don't take advantage