Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hydQb-0005cQ-KF for pgsql-general@arkaria.postgresql.org; Fri, 16 Aug 2019 14:42:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hydQa-0002HO-9n for pgsql-general@arkaria.postgresql.org; Fri, 16 Aug 2019 14:42:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hydQZ-000283-RK for pgsql-general@lists.postgresql.org; Fri, 16 Aug 2019 14:42:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hydQX-0000dQ-Hq for pgsql-general@postgresql.org; Fri, 16 Aug 2019 14:42:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x7GEfx1N019660; Fri, 16 Aug 2019 10:41:59 -0400 From: Tom Lane To: PegoraroF10 cc: pgsql-general@postgresql.org Subject: Re: slow queries on system tables In-reply-to: <1565963536657-0.post@n3.nabble.com> References: <1565879436637-0.post@n3.nabble.com> <1565896167022-0.post@n3.nabble.com> <88609b1c-1653-6d4c-c1b4-883e109f5b93@aklaver.com> <1565963536657-0.post@n3.nabble.com> Comments: In-reply-to PegoraroF10 message dated "Fri, 16 Aug 2019 06:52:16 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <19658.1565966519.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 16 Aug 2019 10:41:59 -0400 Message-ID: <19659.1565966519@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PegoraroF10 writes: > Values for autovacuum and autoanalyse are Null because I did not configured > them for system tables yet, but I´m doing vacuum manually once a week. My > question now is why those selects varies that way. Well, one point is that the execution time would probably vary hugely depending on what's supplied for the parameters in WHERE n.nspname LIKE $4 AND t.relname LIKE $5 which you haven't told us. I'm also wondering about just how many rows get emitted by "generate_series($2, indnatts - $3)", and why that particular part of the query makes any sense at all. regards, tom lane