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 1id3vl-0002nK-TE for pgsql-docs@arkaria.postgresql.org; Fri, 06 Dec 2019 03:05:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1id3vk-00011f-52 for pgsql-docs@arkaria.postgresql.org; Fri, 06 Dec 2019 03:05:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1id3vi-0000yF-Cq for pgsql-docs@lists.postgresql.org; Fri, 06 Dec 2019 03:05:19 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1id3vd-0002Aq-Pm for pgsql-docs@lists.postgresql.org; Fri, 06 Dec 2019 03:05:18 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0DA25226BA; Thu, 5 Dec 2019 22:05:10 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 05 Dec 2019 22:05:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=Pd+fSpRDco0PttXNgfKbCVCswwl ZbKdArHF8YGCAWKg=; b=grnZO01RVrsS/T1p40yMLCeAMhWyNUyQODmBGSQwker zONn6k73fqlEHgqhd7DYCqvLSHDj71f/Fhn27neJk8Rp91JQBstRifPM1rXWuYSM omS/DiLgP3Jf/38JHLipswdnVVe+l+CT+FWbeYshesS1arle77X065KTrSKKjDC6 5BJbZwn1ubj2o8r60plRp28B6Mc16vPb9qwBE/L8a8Fomo9Hu0sQOVII45uuEYap yJJYMTW9XjzXuYUAD41pb02kx/dIYBV9cv5LBv9kREEVheAQy0ThdPh3XxhCCOsI EQ8cy+JqzO/v1XIeJ4fALenmcPQOw2twNZ+ky01f6YA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Pd+fSp RDco0PttXNgfKbCVCswwlZbKdArHF8YGCAWKg=; b=JG9PJd43vB5y4joyu7u8Sz 5jHUNux72XV64b7vfFNbYJ9yGL1b7Ss+p4a+7yqPCP/R3jIOA1d5Dau0Nxbzlq/I BGbKejv+6XKTAGaMLW9AO2n0rWH3OqrmM0Vc7QeDgCYfzoVZkLca8WdptoaYbapl BuXntSMPpOGCnylTRzTrD1xKygxdh6/HJKSRgBZmFhlIKJ5s9fTe++F+bDNKoqQw Wf4UMf88AaHsZ7xmr2Y3q6bCk7BEmPDoTPUCnxVSrfLlUDZSoNObR++BwzBbBc4L 27isgbjuXPLrNbSQ0XKIGB1HJcLD/n4ngjS2/qqWiBXpHdeJ2yCq4o0Uc/x8glcQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudekvddgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecu kfhppeduuddurddutddvrddukedtrddukeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmihgthhgrvghlsehprghquhhivghrrdighiiinecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id B3C878005B; Thu, 5 Dec 2019 22:05:02 -0500 (EST) Date: Fri, 6 Dec 2019 12:04:45 +0900 From: Michael Paquier To: James Salsman Cc: pgsql-docs@lists.postgresql.org Subject: Re: monitoring-stats.html is too impenetrable Message-ID: <20191206030445.GI121835@paquier.xyz> References: <157458791863.7229.15011272113637426410@wrigleys.postgresql.org> <20191125012036.GC37821@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="byLs0wutDcxFdwtm" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --byLs0wutDcxFdwtm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 04, 2019 at 03:29:55AM -0800, James Salsman wrote: > Thank you for your thoughtful reply. This might be much easier: >=20 > How about adding another example to > https://www.postgresql.org/docs/11/planner-stats.html ? Not sure I see the parallel here. This page talks about planner statistics, and yours about being able to find missing indexes because of incorrect stats. > SELECT relname, seq_scan-idx_scan AS too_much_seq, > case when seq_scan-idx_scan>0 THEN 'Missing Index?' ELSE 'OK' END, > pg_relation_size(relid::regclass) AS rel_size, seq_scan, idx_scan > FROM pg_stat_all_tables > WHERE schemaname=3D'public' AND pg_relation_size(relid::regclass)>80000 > ORDER BY too_much_seq DESC; Again. this is a bit more complex than that. -- Michael --byLs0wutDcxFdwtm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl3pxU0ACgkQnvQgOdby QH01qg/9F0tzrokHkXzG76qxckuOeXwrXQLPNpXZzJpdqRVZ5kIu+yVe9AXIj+H8 bJYd3eKza6DxA+1dJOOIKj1QDarTldEAXwXiAlllAtBF7KyiGzVz55eTICEYFf/w pWf4Js9OzZSzENWS7efDTKGrwLt0U+bIq+1l3QGY9ByPUeil9b+UDd89t9p+fzZF HqVCU7s2hoH26k/dSkvFL9sx2e2QbCq+Gi37DR7ChkM4PDKx1Bd6McFFCZR5uZyy dctcFQ6aI39fI97SDruJKZoDeWUKi/hvHv4+9vNRHSxnTnPCUUXdDMRQ1gA6y3Uv mWi/NWuv56DIGcSA13vBvC3+DZqZht58wUMy6VbniJ17VMLcnvhxCAX7jD4/IzVU 2A/wUTPyPkwQsY/cEQXguOCl0Eg/LO5N+ppu5EQyPupIxNAJ69caBSyNnxSucWwt cv+zZvdmSyb+SgW44V3J7jD1o2NbcqFL/eMoLuLPyoStJNuHb7V9H0rjdZ75eFeo zjn8tkKB9RfrT+bj03m1n+iPE39zZc0LmBGpKutqA6CQfeV1gUSK/r4k2CNmcm9j rIuIY7oagesD435vLaaE1tApsdANP97HiidtCbn8faQFb8moA7/T2LBZaWMg24xD iorYsX6xCncOY+/I2AMvRZqm/sKLWoQj1Fzx+Zzl6p0keW//gGU= =UXMd -----END PGP SIGNATURE----- --byLs0wutDcxFdwtm--