Re: slow queries on system tables

From: PegoraroF10 <marcos(at)f10(dot)com(dot)br>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: slow queries on system tables
Date: 2019-08-23 22:28:19
Message-ID: 1566599299931-0.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message PegoraroF10 2019-08-23 22:31:13 Re: slow queries on system tables
Previous Message Adrian Klaver 2019-08-23 22:23:55 Re: slow queries on system tables