Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ab9w2-0001Rg-VD for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Mar 2016 16:47:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ab9w2-000894-FZ for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Mar 2016 16:47:38 +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) (envelope-from ) id 1ab9w1-00086v-HB for pgsql-hackers@postgresql.org; Wed, 02 Mar 2016 16:47:37 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ab9vy-0003WP-Ni for pgsql-hackers@postgresql.org; Wed, 02 Mar 2016 16:47:36 +0000 Received: by mail-wm0-x22a.google.com with SMTP id p65so86173607wmp.0 for ; Wed, 02 Mar 2016 08:47:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=P1HEpVdQOn57nbP+xbWw6alwza3spXTAQU0APpkcQG0=; b=oppu0swO10O/fdmyQ8eX8GXVCqFHf54Se+EQ0k3Symws5kMkZX/CvlrUiRXIw/cTE9 O23YYuaKcxZ1nyJ/x084xCtehPS/BYjl7Z6ksJwb/b3bi8lBgjAONWe9jiYKF555AUZ6 77/1eE5d0hePAX0ud74JIlPsFRBTggC79K6NB5ZKjykunYtA9RJn97a1qCoNf4ylgwf9 0fCJ/WeiVqk6cXwREOYGAWFIFhP+qkKZmyFvSkuOTPgULsEpyC3ZAj/1j3AaqDvJcMrO lbPeBMBuEnMI6hEqBR4c9IUGSxD3aMa1qmh0CBV+q0xsKI42K9C+BVghDfVgIRJZBO5X J/zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=P1HEpVdQOn57nbP+xbWw6alwza3spXTAQU0APpkcQG0=; b=IGLM0FZ1KFtKuWRMFfj/+5iVzZ0c4X2tNAwm8JsEGRLIgFqh8JdAtRHUEFNC6mHEsB mEVduQgFdKtrofBTV+7NgGPP4vNN+XUpRj4vkj7Zwcrzpk3h7rZ3/iCSlhrmgE7Zy59c iSmVgfRY4qqPIwhmoOC6vAGjg6+UZb10pj1yvyxxJulj6vTFDZV2jARiYORU17EkpX8w NjTcHxc3r8kItheY55rphNkY8DpVQIXus93TXJBtVLAdvXkSn7YCJMvuliP3iEDmW75X DWU1kpo4bzFHPF++6rF8pzyB679BIqusrqiLya0ZXf8FNgC9fd5VfzgviyrPH9ypQL4z 3AMA== X-Gm-Message-State: AD7BkJKgeeVcoE21GGAeLewbBi1T3D6vppVj7qI8ltr1lnz90aUipjOn8Lr2whcmIp2jeaw1CDsCNAuvWjDvcWweqnQ4Dn5iBgyJM+k0Ly0eBb4/EQnk1eWiM5QTbW8KWLYsmScQJNMlKgbdh8DBKPWXsH1fvDSli6s5ZZCzBHCp8sOAlNwvcc13vHoJ2FPo7FCmFCBra6RV X-Received: by 10.28.6.71 with SMTP id 68mr916202wmg.41.1456937252608; Wed, 02 Mar 2016 08:47:32 -0800 (PST) Received: from [10.137.1.13] (ip-78-45-216-26.net.upcbroadband.cz. [78.45.216.26]) by smtp.gmail.com with ESMTPSA id y3sm4955359wmy.17.2016.03.02.08.47.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Mar 2016 08:47:31 -0800 (PST) Subject: Re: multivariate statistics v10 To: Thom Brown References: <543AFA15.4080608@fuzzy.cz> <567AF104.80700@2ndquadrant.com> <569DBA67.9020403@2ndquadrant.com> <56D6FF1C.5060303@2ndquadrant.com> Cc: PostgreSQL-development From: Tomas Vondra Message-ID: <56D71921.9080509@2ndquadrant.com> Date: Wed, 2 Mar 2016 17:47:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) 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 Hi, On 03/02/2016 05:17 PM, Thom Brown wrote: ... > Well, firstly, the patches all apply. > > But I have a question (which is coming really late, but I'll ask it > anyway). Is it intended that CREATE STATISTICS will only be for > multivariate statistics? Or do you think we could add support for > expression statistics in future too? > > e.g. > > CREATE STATISTICS stats_comment_length ON comments (length(comment)); Hmmm, that's not a use case I had in mind while working on the patch, but it sounds interesting. I don't see why the syntax would not support this - I'd like to add support for expressions into the multivariate patch, but that will still require at least 2 columns to build multivariate statistics. But perhaps it'd be possible to relax the "at least 2 columns" requirement, and collect regular statistics somewhere. So I don't see why the syntax could not work for that case too, but I'm not going to work on that. > > > I also note that the docs contain this: > > CREATE STATISTICS [ IF NOT EXISTS ] statistics_name ON table_name ( [ > { column_name } ] [, ...]) > [ WITH ( statistics_parameter [= value] [, ... ] ) > > The open square bracket before WITH doesn't get closed. Also, it > indicates that columns are entirely options, so () would be valid, but > that's not the case. Also, a space is missing after the first > ellipsis. So I think this should read: > > CREATE STATISTICS [ IF NOT EXISTS ] statistics_name ON table_name ( > { column_name } [, ... ]) > [ WITH ( statistics_parameter [= value] [, ... ] ) ] Yeah, will fix. regards -- Tomas Vondra http://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