Re: Do table-level CHECK constraints affect the query optimizer? - Mailing list pgsql-general

From Mark Dilger
Subject Re: Do table-level CHECK constraints affect the query optimizer?
Date
Msg-id D1BF0ED4-64AE-4A00-8449-A877DC8B2A99@enterprisedb.com
Whole thread Raw
In response to Re: Do table-level CHECK constraints affect the query optimizer?  (Ron <ronljohnsonjr@gmail.com>)
List pgsql-general

> On Jun 29, 2021, at 10:33 AM, Ron <ronljohnsonjr@gmail.com> wrote:
>
> Prod is brand new.  Loaded on Saturday; we saw this problem on Sunday during pre-acceptance.  Thus, while running
ANALYZEwas top of the list of Things To Do, running VACUUM was low. 
>
> Is that a mistaken belief?

You might want to run VACUUM FREEZE and then retry your test query using EXPLAIN.  See if it switches to an index only
scanafter the VACUUM FREEZE. 

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company






pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Do table-level CHECK constraints affect the query optimizer?
Next
From: Ron
Date:
Subject: Re: Do table-level CHECK constraints affect the query optimizer?