Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5z65-0003vR-Bk for pgsql-hackers@arkaria.postgresql.org; Wed, 03 May 2017 18:33:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d5z64-0005zi-Ua for pgsql-hackers@arkaria.postgresql.org; Wed, 03 May 2017 18:33:56 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d5z62-0005wf-EP for pgsql-hackers@postgresql.org; Wed, 03 May 2017 18:33:54 +0000 Received: from mail-qt0-x232.google.com ([2607:f8b0:400d:c0d::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d5z5z-000404-DS for pgsql-hackers@postgresql.org; Wed, 03 May 2017 18:33:53 +0000 Received: by mail-qt0-x232.google.com with SMTP id n4so46747568qte.2 for ; Wed, 03 May 2017 11:33:50 -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=pGHRsOP19ysFVEmCcFXOGUQyMUMYXwBAazsp2HHQMEs=; b=WtDbU1IBvgb0+oQclw8+7iUw0c/Gf1yf2uQBPh2pvEJf8KygKLZc/CkiNQ9e1BxRtM Ux+QkxJpZcFi3/ppCRa3tYkaXER7q1YAwmBQCvK+3OJ0Bu0K41bNEXjF0Kz1nuQOE5kI rspgqZe3eryqq+OC/rFtdQv+Q6MY5ZEtwq+1HeaUaE7Fd1xY0afPGPoVw+0gqmozlyYP PPOdjQZwwTNBlcSQcPpMoF3HNfMihzvYbKVpDcAiwytpvTbV7ahYiDld/515helNVGlP 79ewKZNIfGx4LNUO2NDmddXlkkflRmt0hXUG86Q1IUVBTbyRnfthXfDR9uljEkj0HAgN v1lQ== 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=pGHRsOP19ysFVEmCcFXOGUQyMUMYXwBAazsp2HHQMEs=; b=W2safVVaRhjkU8QVAoHmIrv7+N9YjwO5jVK3dcHYxXajr+tssM9qoL9ZUX4QKvgrKO 6jCFhc1cKc/EUz/QuvI1KaIsdOB+bGSrAcboihJB455EXaNcZk7XPjZsHaKtIK/YHtWy PeiPfj4/HbFVIKXowuD6jWeQNWSgmOLXlRHwp36BQKSdUY1W9giphz9hInQJoE6UOHej COcTb0W7MbkeSjFUCnV1NxWX3ILhc+/4UmQErNYonOJMjiXgEmBN9xQwxmSbttdDcE19 bn/NtQkNj0B+hFEa2moWbU52IZ4RsIRj/02Mo3HgmCdSJniEStVVP8lLGgWrBCgyzcDc Q+CQ== X-Gm-Message-State: AN3rC/5e1cFytiD/lpWT0CTlx4W7uTAsMJdwki4iolgO1/4KW2mIpAUl FHLnNT0ujk3/nVca X-Received: by 10.237.37.209 with SMTP id y17mr10076049qtc.140.1493836430227; Wed, 03 May 2017 11:33:50 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([190.217.209.130]) by smtp.gmail.com with ESMTPSA id b41sm17316579qte.38.2017.05.03.11.33.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 May 2017 11:33:49 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 074B5689; Wed, 3 May 2017 15:33:42 -0300 (-03) Date: Wed, 3 May 2017 15:33:42 -0300 From: Alvaro Herrera To: Simon Riggs Cc: Tomas Vondra , PostgreSQL-development , Tom Lane , Dean Rasheed Subject: Re: WITH clause in CREATE STATISTICS Message-ID: <20170503183342.n66mailptvx3jxe5@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170503151801.4u46436mc64r2bfa@alvherre.pgsql> User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Alvaro Herrera wrote: > Simon Riggs wrote: > > > 2. > > USING keyword, no brackets > > CREATE STATISTICS s1 USING (dependencies, ndistinct) ON (a, b) FROM t1 > > WHERE partial-stuff; > > > > and if there are options, use the WITH for the optional parameters like this > > CREATE STATISTICS s1 USING (dependencies, ndistinct) WITH (options) ON > > (a, b) FROM t1 WHERE partial-stuff; > > > > > > I think I like (2) > > OK, sounds sensible. Yawn. So, we have not achieved the stated goal which was to get rid of the ugly clause in the middle of the command; moreover we have gained *yet another* clause in the middle of the command. Is this really an improvement? We're trading this CREATE STATISTICS s1 WITH (dependencies, ndistinct, options) ON (a, b) FROM t1 WHERE partial-stuff; for this: CREATE STATISTICS s1 USING (dependencies, ndistinct) WITH (options) ON (a, b) FROM t1 WHERE partial-stuff; Can we decide by a show of hands, please, whether we're really on board with this change? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers