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 1id9gH-0007nu-8L for pgsql-docs@arkaria.postgresql.org; Fri, 06 Dec 2019 09:13:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1id9gE-0007zw-Th for pgsql-docs@arkaria.postgresql.org; Fri, 06 Dec 2019 09:13:42 +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 1id44c-0004bp-KO for pgsql-docs@lists.postgresql.org; Fri, 06 Dec 2019 03:14:30 +0000 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1id44Z-0002Je-NP for pgsql-docs@lists.postgresql.org; Fri, 06 Dec 2019 03:14:30 +0000 Received: by mail-oi1-x241.google.com with SMTP id v140so4921928oie.0 for ; Thu, 05 Dec 2019 19:14:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V7CdP9V3RU6gfgv3SFv7qEBi+jvnfJ3yxJsZI6+q5Jw=; b=P3gV541xB+A0PCPddGiPcFDpZ0eNET2I7mH5XKcMDYL/yAom4SY65Tte/wjLLFFTHP Mp8imroWz3DCmgVLB6LQSigi/RvfSeGboxoMSr5VGwzAMlVHTe+fZwsz2iUehv58BnzX rwm2ga84uwWc1UC+ow4BOFVozL8Cs/YjOCwDiRl9w+PEe4uAA/NffnS0XN4DkLxYitNm A5tTjULySHMoEa2ACM6pPlPKw8cILn+Ne/mzAW0TWqFXKKY8p0cbWp95xlKXC5D3JFgN ohrAip7r3sAxs5VllgcQ4iX2PnCDfMry4AuMqViAPVNbBDVCbbPAoDtk1y0kv1endE7J WfiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V7CdP9V3RU6gfgv3SFv7qEBi+jvnfJ3yxJsZI6+q5Jw=; b=rMpVU5/QKoI7qcffy6qB8Eq5vNnlGXueSNcm3B+b+UWWwCpXQY0PmsOefH02ON337x GiUOZ94uJd8FuHlNaExaTCFmlEMOia54jPe2b59p5USWM4rA61JhR/zF9XZxbDebdAJ/ i85jVxEgWyHJu+qnRrSpCaOa6TH2cj7BqtTRQmdBhsxdVkr2riO4l45wY1QXZ06X5gJh mm2yY63jirqZEKu/euUkMF0SkCkr847PGwDYx4ym7ARsPRbe4M1/n+0dwYSv68nUcjzi r0iK7P/6Jhg86sJNBHao0TY/ZwOMmpHfMyes9r7HT6hFjwPdxYyr/pGRI7ObD355YHlj c99Q== X-Gm-Message-State: APjAAAUThpQpdjrYf3Nd0NtCxHoYrqG+xpBEBosRIYWnDsFbC1ooV1tI SOdDBJf0TyusKQw2L/FTsZDbF/t0tsL0XhwE48e8VMWC X-Google-Smtp-Source: APXvYqzEy4XkXPEbRm4wYSubV9KKNI0Tj59JqnCfleaVxaFopZLCfoAGsoZrPUH4Rpq5CXxVxOWOH6W5993J1ydsUWk= X-Received: by 2002:aca:f514:: with SMTP id t20mr10651891oih.24.1575602065356; Thu, 05 Dec 2019 19:14:25 -0800 (PST) MIME-Version: 1.0 References: <157458791863.7229.15011272113637426410@wrigleys.postgresql.org> <20191125012036.GC37821@paquier.xyz> <20191206030445.GI121835@paquier.xyz> In-Reply-To: <20191206030445.GI121835@paquier.xyz> From: James Salsman Date: Thu, 5 Dec 2019 19:14:14 -0800 Message-ID: Subject: Re: monitoring-stats.html is too impenetrable To: Michael Paquier Cc: pgsql-docs@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thanks, Michael, but I am absolutely convinced that whether a needed index exists or not is absolutely one of the most run-time consequential inputs to the query planner. Also, that page is where people look to optimize, unlike the impenetrable wall-of-text stats page. Please correct me if I am wrong. Thank you for your consideration. Best regards, Jim On Thu, Dec 5, 2019 at 7:05 PM Michael Paquier wrote: > > On Wed, Dec 04, 2019 at 03:29:55AM -0800, James Salsman wrote: > > Thank you for your thoughtful reply. This might be much easier: > > > > 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='public' AND pg_relation_size(relid::regclass)>80000 > > ORDER BY too_much_seq DESC; > > Again. this is a bit more complex than that. > -- > Michael