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: Sat, 24 Aug 2019 02:12:02 -0700 (MST)
Message-ID: <1566637922958-0.post@n3.nabble.com> (raw)
In-Reply-To: <CAHOFxGpvu5r4weCf1Y_EAo+cnxLvC3ktL5pVHpbaVqNSd0kXBA@mail.gmail.com>
References: <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>
	<0eca5ab6-82cf-9768-6f09-0cb9998a1fdf@aklaver.com>
	<1566599473175-0.post@n3.nabble.com>
	<CAHOFxGpvu5r4weCf1Y_EAo+cnxLvC3ktL5pVHpbaVqNSd0kXBA@mail.gmail.com>

these values were collected before vacuum analyse:select (select reltuples
from pg_Class where relName = t.relName), * from pg_stat_sys_tables t where
schemaname = 'pg_catalog' and relname in
('pg_class','pg_attribute','pg_index');
reltuples	relid	schemaname	relname	seq_scan	seq_tup_read	idx_scan
idx_tup_fetch	n_tup_ins	n_tup_upd	n_tup_del	n_tup_hot_upd	n_live_tup
n_dead_tup	n_mod_since_analyze	last_vacuum	last_autovacuum	last_analyze
last_autoanalyze	vacuum_count	autovacuum_count	analyze_count
autoanalyze_count
930475	1249	pg_catalog	pg_attribute	22462	61582178	646833988	2785143399
25381	776	15287	566	10094	15497	41444	NULL	NULL	NULL	NULL	0	0	0	0
169186	1259	pg_catalog	pg_class	5541140	39631813757	638041068	2316793709
2243	75187	625	44008	169891	5645	7435	NULL	2019-08-22 19:58:48.497317	NULL
2019-08-22 13:03:02.770579	0	415	0	1
87387	2610	pg_catalog	pg_index	5263825	33638625440	246528384	590160274	1142
0	208	0	934	208	1350	NULL	NULL	NULL	NULL	0	0	0	0
Then ... vacuum analyze pg_catalog.pg_index;vacuum analyze
pg_catalog.pg_attribute;vacuum analyze pg_catalog.pg_class;
reltuples	relid	schemaname	relname	seq_scan	seq_tup_read	idx_scan
idx_tup_fetch	n_tup_ins	n_tup_upd	n_tup_del	n_tup_hot_upd	n_live_tup
n_dead_tup	n_mod_since_analyze	last_vacuum	last_autovacuum	last_analyze
last_autoanalyze	vacuum_count	autovacuum_count	analyze_count
autoanalyze_count
940569	1249	pg_catalog	pg_attribute	22550	61582570	646919000	2785430403
25381	776	15287	566	940569	0	0	2019-08-24 09:01:26.334472	NULL	2019-08-24
09:01:27.169883	NULL	1	0	1	0
150903	1259	pg_catalog	pg_class	5542002	39640547448	638133339	2316941739
2243	75187	625	44008	150903	0	0	2019-08-24 09:01:33.130845	2019-08-22
19:58:48.497317	2019-08-24 09:01:33.441355	2019-08-22 13:03:02.770579	1	415
1	1
88321	2610	pg_catalog	pg_index	5263994	33639781274	246576056	590229532	1142
0	208	0	88321	0	0	2019-08-24 09:01:18.080615	NULL	2019-08-24 09:01:18.275907
NULL	1	0	1	0
and this is explain before
https://explain.depesz.com/s/fUNB
and after
https://explain.depesz.com/s/1FZR



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

view thread (16+ messages)

Message-ID: <1566637922958-0.post@n3.nabble.com>
Permalink:  ../1566637922958-0.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1566637922958-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: <1566637922958-0.post@n3.nabble.com>
  References: <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> <0eca5ab6-82cf-9768-6f09-0cb9998a1fdf@aklaver.com> <1566599473175-0.post@n3.nabble.com> <CAHOFxGpvu5r4weCf1Y_EAo+cnxLvC3ktL5pVHpbaVqNSd0kXBA@mail.gmail.com> <1566637922958-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