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 1kDDW6-0004I0-08 for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Sep 2020 21:08:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kDDW4-0007eX-Pe for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Sep 2020 21:08:32 +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 1kDDW4-0007eQ-E6 for pgsql-hackers@lists.postgresql.org; Tue, 01 Sep 2020 21:08:32 +0000 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kDDW1-0001lM-GM for pgsql-hackers@postgresql.org; Tue, 01 Sep 2020 21:08:31 +0000 Received: by mail-qv1-xf43.google.com with SMTP id db4so1085565qvb.4 for ; Tue, 01 Sep 2020 14:08:29 -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=sm9uOC5/xmKKH18N3qY+N1WS7K47Hvy0r3VfMjPGov8=; b=EAOZGvPXAZcng7f5wVVlFa280MvyTXXd0+dF7JS/abYn3J5MWTpe1PtmWeWloAU5W/ KlloskYU0k0XZZOHzFv9HZRze2mjIl1/oSniT5V7FzOYrFT8Darxw3gDIh+Pa6dzEm3I hIAK2Ko5IQ8mJlFL2mSQm+bpD6mIICzWEV8+VBXIZQME8QFYdAzxm/SGyJz7h2RamsrM bIuHLBiDoeXvKyr4AYpf3xyaGbpx+ECWGAdJuo9lpvUzclm/Mc0GmujaZt/4P91UIZzS i3TLx0NzxOSdF7lkCbjbG2DdOIYvNJW08urQWS6Rc8RzVIGc+KZJaUl01N6WNNfccOGB FvXg== 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=sm9uOC5/xmKKH18N3qY+N1WS7K47Hvy0r3VfMjPGov8=; b=gtrrywuIaTVx9op0BiASBi7sLDZ7CKWTdDnO6LZ5k9xfrHoGztbrWqCiuajjaOAvZm aIYa8UXly5HIX9N078ohKYnK+nbNgJKg8B+kA78VMlYA6ASCA9fSRc0c7HqPJZiuv3tJ d/ml5M1AiAfLAfcjqj7GKu6kOGg0/EnBb8a4x9M++7RBpPxzVIs37zHRU/xkvLGeQVXt 5nVN2Cml9n8ijumwQ8l7fgNwdzzzM2K5rbQyEZqMtJq6/zQTOl2IvkmIo3YpJ/8e/oB1 fRZ+xnlCZQOP3ewOybJ4XGxP12fbuIac6ujnuhxT4b4UaxZJHOtt1oEHY+nKcLbbByG5 D+rQ== X-Gm-Message-State: AOAM5321kZYGlZWtCb3ghGMhTDBYriskdWLwDf1f+INAn2awuRvMKdgl zk5zf96fhwsckSbHWe29L7Uaaw== X-Google-Smtp-Source: ABdhPJziemg3W6phv4kS0p5KAzByTAHqQJX3kSDWx4GMspPxrRcQyGygxQv6XNRJFLRNuaL40NYSzw== X-Received: by 2002:ad4:4e89:: with SMTP id dy9mr3958345qvb.25.1598994507842; Tue, 01 Sep 2020 14:08:27 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.47]) by smtp.gmail.com with ESMTPSA id 194sm2787910qke.36.2020.09.01.14.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 14:08:27 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 7892F2A1557; Tue, 1 Sep 2020 17:08:25 -0400 (-04) Date: Tue, 1 Sep 2020 17:08:25 -0400 From: Alvaro Herrera To: Justin Pryzby Cc: gkokolatos@pm.me, pgsql-hackers@postgresql.org, Tomas Vondra , Tatsuro Yamada Subject: Re: v13: show extended stats target in \d Message-ID: <20200901210825.GA20170@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200901011429.GZ5450@telsasoft.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk +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. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services