pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PegoraroF10 <marcos@f10.com.br>
To: pgsql-general@postgresql.org
Subject: Re: slow queries on system tables
Date: Fri, 23 Aug 2019 15:28:19 -0700 (MST)
Message-ID: <1566599299931-0.post@n3.nabble.com> (raw)
In-Reply-To: <CAHOFxGqftoP6-0YbRqRZbZ=_Zbn6iELvQDfHz3Sc0uJo_z8_Bw@mail.gmail.com>
References: <1565879436637-0.post@n3.nabble.com>
	<CAHOFxGrV0dj+4=s5-0-XG36_13t3smhKq0hujmRNaKqtfZ3YuA@mail.gmail.com>
	<1565896167022-0.post@n3.nabble.com>
	<88609b1c-1653-6d4c-c1b4-883e109f5b93@aklaver.com>
	<1565963536657-0.post@n3.nabble.com>
	<19659.1565966519@sss.pgh.pa.us>
	<1565968275886-0.post@n3.nabble.com>
	<1566596875387-0.post@n3.nabble.com>
	<CAHOFxGqftoP6-0YbRqRZbZ=_Zbn6iELvQDfHz3Sc0uJo_z8_Bw@mail.gmail.com>

https://explain.depesz.com/s/5Rrd

EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS) SELECT
current_database() AS TABLE_CATALOG, n.nspname AS TABLE_SCHEMA, t.relname AS
TABLE_NAME, t.oid AS TABLE_OID, current_database() AS INDEX_CATALOG,
n.nspname AS INDEX_SCHEMA, c.relname AS INDEX_NAME, c.oid AS INDEX_OID,
a.attname AS COLUMN_NAME, a.attnum AS COLUMN_POSITION,indoption[index] & 1
AS DESCENDING , indisunique::integer AS UNIQUE FROM   (SELECT
generate_series(0, indnatts - 1), indrelid, indexrelid, indkey,   indoption,
indisunique, indisprimary FROM pg_index i)   i(index, indrelid, indexrelid,
indkey, indoption, indisunique, indisprimary)  INNER JOIN pg_class c ON
c.oid = indexrelid   INNER JOIN pg_class t ON t.oid = indrelid   INNER JOIN
pg_namespace n ON n.oid = t.relnamespace   INNER JOIN pg_attribute a ON
a.attrelid = indrelid AND a.attnum = indkey[index] WHERE n.nspname LIKE
'f10_0275, public' AND t.relname LIKE 'sys_var' ORDER BY
indisprimary::integer DESC, n.nspname, t.relname, c.relname, a.attnum;



--
Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html





view thread (16+ messages)  latest in thread

Message-ID: <1566599299931-0.post@n3.nabble.com>
Permalink:  ../1566599299931-0.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1566599299931-0.post@n3.nabble.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: marcos@f10.com.br
  Subject: Re: slow queries on system tables
  In-Reply-To: <1566599299931-0.post@n3.nabble.com>
  References: <1565879436637-0.post@n3.nabble.com> <CAHOFxGrV0dj+4=s5-0-XG36_13t3smhKq0hujmRNaKqtfZ3YuA@mail.gmail.com> <1565896167022-0.post@n3.nabble.com> <88609b1c-1653-6d4c-c1b4-883e109f5b93@aklaver.com> <1565963536657-0.post@n3.nabble.com> <19659.1565966519@sss.pgh.pa.us> <1565968275886-0.post@n3.nabble.com> <1566596875387-0.post@n3.nabble.com> <CAHOFxGqftoP6-0YbRqRZbZ=_Zbn6iELvQDfHz3Sc0uJo_z8_Bw@mail.gmail.com> <1566599299931-0.post@n3.nabble.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