Re: view reading information_schema is slow in PostgreSQL 12 - Mailing list pgsql-performance

From Michael Lewis
Subject Re: view reading information_schema is slow in PostgreSQL 12
Date
Msg-id CAHOFxGpDPALxkCVQwVmCA0TGM5RVoDGDEqizRuRNmOgx-MQHAQ@mail.gmail.com
Whole thread Raw
In response to view reading information_schema is slow in PostgreSQL 12  (regrog <andrea.vencato@gmail.com>)
List pgsql-performance
On Fri, Jun 12, 2020 at 12:26 PM regrog <andrea.vencato@gmail.com> wrote:
I'm facing performance issues migrating from postgres 10 to 12 (also from 11
to 12) even with a new DB.
Th performance difference is huge 300ms in pg10 vs 3 minutes in pg12.

I have a view that abstracts the data in the database:

CREATE OR REPLACE VIEW public.my_constraints


Assuming your DDL changes fairly seldomly, and you already have a well structured deployment process in place for that, perhaps just change this to a materialized view and refresh (concurrently) after any DDL gets executed. That way, you have stats on what your view has in it and are not subject to issues with planning the execution of the query in this view. 

pgsql-performance by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: Performance issue
Next
From: regrog
Date:
Subject: Re: view reading information_schema is slow in PostgreSQL 12