Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kCknj-000844-6k for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Aug 2020 14:28:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kCknh-0001zF-Vd for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Aug 2020 14:28:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kCknh-0001z8-LF for pgsql-hackers@lists.postgresql.org; Mon, 31 Aug 2020 14:28:49 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kCkna-0001Yg-Ph for pgsql-hackers@lists.postgresql.org; Mon, 31 Aug 2020 14:28:49 +0000 Received: by mail-qk1-x743.google.com with SMTP id d20so3459785qka.5 for ; Mon, 31 Aug 2020 07:28:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=Y+Job1ED+pZfKWeAT3iq2aU/7d+FoybBsA0owlc/e9s=; b=iia/5txVdn6yQIo3jjqm5+8rRRx06Cn5L/2P0yqrL2bu4KWdhwF14HuqMY/f7WI3lx qwxOeWTxbQ/txNtF+UdQpOz7aDeUxbKizJ0CU3RRsy0Nuf0/ruJJevZ78w2ofFuSE7o9 FsWij7gbRATKhQuhgEAghSr/+91e1vw77YX9Sc9uu6sTpEbH8ElFhlU2dogNTIKMe2Vh RkVeInIbUYO+/rryoO5nutHy6AaEC57CaMHUjmZH2rcMiyDrxEUaMKUo0tw6048ERYop hqlsju8dUpzQlFobXGJCNGHjen+t7ZoaK7mQWIZ1y6Rr874d5be25uifeLH62MaB+04l NNqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Y+Job1ED+pZfKWeAT3iq2aU/7d+FoybBsA0owlc/e9s=; b=Eb33IR9q1gyraOGPMxKfRiehwiZrfkHgIAjPIh2e6WYb0thtZLvBsZqCm7yRp1ZF1W fOeUpTZ0cQWc/rMRVUzLLOXyWt6NtqNMx5brNQh3qV0z1WWd1UjL83gHLoIOdRNR8J7Z Q5bPRnE0iBsI/DM+mxIjAuEbhm6u3WgxokeQyS+a8fr86zl/DcnO6uYriE8CfITQBjcw mrnfylSTlmX8fOhb0rZj1ke+LV1yisopWBYZZva6cjlyIFA8vgjrSxKPSQaI97cUnFqV RHTj4HilDdWAQxdFZhbTG3N9NZurgL+Ek9LTqDrGGMuEScanbr98In3DhVpN7VN0RkP9 Af8A== X-Gm-Message-State: AOAM532tDH/21gSBnlsDcnnK8kQKWYGVP0yyMG/HljEZWvX36jr/AMTu TAYxD7WHqTm+xYjKRTa78rS7OA== X-Google-Smtp-Source: ABdhPJwqdrkSFBH4NFmP8Cj+hB7jRLDPbTl/nVeOlt219O5bLJbaYM3s3gpjAGVJn4K0FVU+ggJwRA== X-Received: by 2002:a37:6892:: with SMTP id d140mr1527582qkc.58.1598884121047; Mon, 31 Aug 2020 07:28:41 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.47]) by smtp.gmail.com with ESMTPSA id c7sm9652108qkd.92.2020.08.31.07.28.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 07:28:40 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 9B33D2A0FB5; Mon, 31 Aug 2020 10:28:38 -0400 (-04) Date: Mon, 31 Aug 2020 10:28:38 -0400 From: Alvaro Herrera To: Tomas Vondra Cc: Tatsuro Yamada , Julien Rouhaud , Pavel Stehule , PostgreSQL Hackers Subject: Re: list of extended statistics on psql Message-ID: <20200831142838.GA30609@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200830164818.b4rl4uk6wzfzrsys@development> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Aug-30, Tomas Vondra wrote: > On Sun, Aug 30, 2020 at 12:33:29PM -0400, Alvaro Herrera wrote: > > I wonder how to report that. Knowing that psql \-commands are not meant > > for anything other than human consumption, maybe we can use a format() > > string that says "built: %d bytes" when \dX+ is used (for each stat type), > > and just "built" when \dX is used. What do people think about this? > > I'd use the same approach as \d+, i.e. a separate column with the size. > Maybe that'd mean too many columns, though. Are you thinking in one size for all stats, or a combined size? If the former, then yes it'd be too many columns. I'm trying to figure out what can the user *do* with that data. Can they make the sample size smaller/bigger if the stats data is too large? Can they do that for each individual stats type? If so, it'd make sense to list each type's size separately. If we do put each type in its own row -- at least "logical" row, say string_agg(unnest(array_of_types), '\n') -- then we can put the size of each type in a separate column with string_agg(unnest(array_of_sizes), '\n') statname | definition | type | size ----------+-----------------+--------------------------+----------- someobj | (a, b) FROM tab | n-distinct: built | 2000 bytes | func-dependencies: built | 4000 bytes another | (a, c) FROM tab | n-distint: enabled | -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services