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 1kDDju-0004ny-MQ for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Sep 2020 21:22:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kDDjt-0007Lw-7u for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Sep 2020 21:22: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 1kDDjt-0007Lp-0b for pgsql-hackers@lists.postgresql.org; Tue, 01 Sep 2020 21:22:49 +0000 Received: from mail-ej1-x642.google.com ([2a00:1450:4864:20::642]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kDDjq-0001tC-71 for pgsql-hackers@postgresql.org; Tue, 01 Sep 2020 21:22:48 +0000 Received: by mail-ej1-x642.google.com with SMTP id d11so3658598ejt.13 for ; Tue, 01 Sep 2020 14:22:45 -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:references:mime-version :content-disposition:in-reply-to; bh=VdTv+hiU2Xfj9SdbZ7HxLzVDd9OuiuI0Jybb0PKF36c=; b=JEudhNFFPKRbFVZoniISM+UCsrwAgEU8uMrQFdfTlwCpsViNxasLZcVSIVmM+KGWMT MZ4uqyYCHEKfY47XfnRGPg4hobyfEZyW69PAnA53BEn+zoJ3zx5umvMQSVStrCChe8ca niNdQLAk15apeiF/leDprY1w0LIv/c5jXYu/QTbuwNC5AFA5qa4GuNr2Dra51SKcHjna SxRYSZtQQyyIU5sLEJOREl0iRkXilMUmIzSPH8F7SGnAfl5yMvXkEowx4P6iERq2LpO9 3W+puAlCMrcU2GsisqGdvqLEJG9ITKFiYD3bqeQQt3UbWQoDFp//vY7MqP4an+478QBI LW4A== 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:references :mime-version:content-disposition:in-reply-to; bh=VdTv+hiU2Xfj9SdbZ7HxLzVDd9OuiuI0Jybb0PKF36c=; b=KxzeM3JwAq4GalP0B2w4st6tlAuOOZdHBq3i0aNazB7czYnYkaMKrbEdRJ2Yz74Mt9 0dydUpyuPvArnflprIvzSSygzt3AMO5vk5idmBSWkG9IN7HyzDqRhJhVmTpCKiwVPFcm tLaXXcqneH5N9X8UVo1Ii6Bl+HnG6Fg9eI1k7w2YaWJVbkTE0ErpjKiLX+H4LZkzII1w Sv5365LYxHnoK+saxBJrXZFQ+SYw17myKB+GhvYrRzVbCwCZMY5Jj+EG6hjvgN/VLNna C4F0zME7//hAW8pBH3mbjoN2X20jzXblmCZ/xbMAFhn/6SFAYfciO7QTjpqzJ9Oia3ZL 343A== X-Gm-Message-State: AOAM533aL0RrrFQABSIvlNgCc4F0fZ+w75tN5yrY5qaN8MuxsswC2ixk DqB0L5TExE6oAQuliXidGsgIlw== X-Google-Smtp-Source: ABdhPJwbiTFAWhG8uvvuTRQuLwVeZ8OqCSaPrGpc34bt5io4gK7Q+SQ044+YlH5NQ9mImSWXAIP/0Q== X-Received: by 2002:a17:906:38c7:: with SMTP id r7mr3518026ejd.118.1598995365079; Tue, 01 Sep 2020 14:22:45 -0700 (PDT) Received: from localhost (ip-86-49-253-216.net.upcbroadband.cz. [86.49.253.216]) by smtp.gmail.com with ESMTPSA id k10sm2141105ejj.108.2020.09.01.14.22.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 14:22:44 -0700 (PDT) Date: Tue, 1 Sep 2020 23:22:42 +0200 From: Tomas Vondra To: Alvaro Herrera Cc: Justin Pryzby , gkokolatos@pm.me, pgsql-hackers@postgresql.org, Tatsuro Yamada Subject: Re: v13: show extended stats target in \d Message-ID: <20200901212242.hgjpy4wswibjee4f@development> References: <20200901011429.GZ5450@telsasoft.com> <20200901210825.GA20170@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200901210825.GA20170@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Sep 01, 2020 at 05:08:25PM -0400, Alvaro Herrera wrote: >+1 on fixing this, since the ability to change stats target is new in >pg13. > >On 2020-Aug-31, Justin Pryzby wrote: > >> Maybe it should have a comma, like ", STATISTICS %s"? > >It does need some separator. Maybe a comma is sufficient, but I'm not >sure: that will fail when we add cross-relation stats, because the >FROM clause will have more relations and possibly have commas too. > > Table "public.ab1" > Column | Type | Collation | Nullable | Default | Storage | Stats target | Description >--------+---------+-----------+----------+---------+---------+--------------+------------- > a | integer | | | | plain | | > b | integer | | | | plain | | >Statistics objects: > "public"."ab1_a_b_stats" (ndistinct, dependencies, mcv) ON a, b FROM ab1 > > >> Also, now I wonder if CREATE STATISTICS should support some syntax to set the >> initial target. Like: >> >> |CREATE STATISTICS abstats ON a,b FROM child.abc_202006 WITH(STATISTICS 111); > >Umm, if true (on which I'm not sold), maybe it should appear in the >parenthesized list that currently is just the stats type list: > > |CREATE STATISTICS abstats (STATISTICS 111) ON a,b FROM child.abc_202006; > >I'm not really convinced we need this. > Me neither. IMHO it's somewhat similar to per-column statistics target, where we don't allow specifying that in CREATE TABLE and you have to do ALTER TABLE ... ALTER COLUMN ... SET STATISTICS n; as a separate step. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services