pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Lars Aksel Opsahl <Lars.Opsahl@nibio.no>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Using system tables directly takes many hours, using temp tables with no indexes takes a few seconds for  geometry_columns view.
Date: Wed, 23 Mar 2022 08:19:21 -0500
Message-ID: <20220323131921.GR28503@telsasoft.com> (raw)
In-Reply-To: <AM7P189MB1028E5ED2EEEE2CE764909649D189@AM7P189MB1028.EURP189.PROD.OUTLOOK.COM>
References: <AM7P189MB1028E5ED2EEEE2CE764909649D189@AM7P189MB1028.EURP189.PROD.OUTLOOK.COM>

On Wed, Mar 23, 2022 at 09:44:09AM +0000, Lars Aksel Opsahl wrote:
> Why is temp tables with no indexes much faster system tables with indexes ?

I think the "temp table" way is accidentally faster due to having no
statistics, not because it has no indexes.  If you run ANALYZE, you may hit the
same issue (or, maybe you just need to VACUUM ANALYZE your system catalogs).

-- 
Justin





view thread (5+ messages)  latest in thread

Message-ID: <20220323131921.GR28503@telsasoft.com>
Permalink:  ../20220323131921.GR28503@telsasoft.com/
Also on:    postgresql.org/message-id/20220323131921.GR28503@telsasoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pryzby@telsasoft.com, Lars.Opsahl@nibio.no, pgsql-performance@lists.postgresql.org
  Subject: Re: Using system tables directly takes many hours, using temp tables with no indexes takes a few seconds for  geometry_columns view.
  In-Reply-To: <20220323131921.GR28503@telsasoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox