Re: Do table-level CHECK constraints affect the query optimizer?

From: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Do table-level CHECK constraints affect the query optimizer?
Date: 2021-06-29 17:46:03
Message-ID: D1BF0ED4-64AE-4A00-8449-A877DC8B2A99@enterprisedb.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Jun 29, 2021, at 10:33 AM, Ron <ronljohnsonjr(at)gmail(dot)com> wrote:
>
> Prod is brand new. Loaded on Saturday; we saw this problem on Sunday during pre-acceptance. Thus, while running ANALYZE was 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 scan after the VACUUM FREEZE.

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2021-06-29 18:02:42 Re: Do table-level CHECK constraints affect the query optimizer?
Previous Message Tom Lane 2021-06-29 17:46:02 Re: Do table-level CHECK constraints affect the query optimizer?