Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XjRTt-0008Hf-W5 for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Oct 2014 11:32:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XjRTt-0001y1-DR for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Oct 2014 11:32:01 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XjRTr-0001xu-MR for pgsql-hackers@postgresql.org; Wed, 29 Oct 2014 11:31:59 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XjRTn-0004U7-OD for pgsql-hackers@postgresql.org; Wed, 29 Oct 2014 11:31:57 +0000 Received: from [10.1.0.2] (190.84.broadband17.iol.cz [109.80.84.190]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0M4a7A-1XzjPg3YYm-00yg4T; Wed, 29 Oct 2014 12:31:53 +0100 Message-ID: <5450D027.3020404@2ndquadrant.com> Date: Wed, 29 Oct 2014 12:31:51 +0100 From: Petr Jelinek User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: David Rowley , Tomas Vondra CC: PostgreSQL-development Subject: Re: WIP: multivariate statistics / proof of concept References: <543AFA15.4080608@fuzzy.cz> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:1ldU646Tv2j2oOOye/yZB8y80865c4CbHv0DRCEXVKN jFGe2EdorO5TyHH/u/9gZecxd9nPgiqEY4Nr/onh4Sxu9+DWQJ I3fhRr3FP+B/kdX6s/Nfnqt4t49cLXXLtIXQk2AZ4+LovgB0TG MTmgtiSonKegmBJtT27m24frt4ETOWQSvJ4zd7OyhP47feQhR9 pygTDLrhqx6FD1ZE/cjtd7q5P5+OvRaM1kvWzyhuuQUsuXAn8x Mg074kCUA2F3wG2qNn6Jsj//O/BmRqtoJnB3/Ash3sDL6IJBoD 8g2it50iwAaoTAgpha8aM+7bp1uLb8GlkASQ14iq3p/77eVYD9 +IDjttHGG+Oxy9eje5ud95ojQI7k79d00su/di5ID X-UI-Out-Filterresults: notjunk:1; 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 On 29/10/14 10:41, David Rowley wrote: > On Mon, Oct 13, 2014 at 11:00 AM, Tomas Vondra > The last point is really just "unfinished implementation" - the syntax I > propose is this: > > ALTER TABLE ... ADD STATISTICS (options) ON (columns) > > where the options influence the MCV list and histogram size, etc. The > options are recognized and may give you an idea of what it might do, but > it's not really used at the moment (except for storing in the > pg_mv_statistic catalog). > > > > I've not really gotten around to looking at the patch yet, but I'm also > wondering if it would be simple include allowing functional statistics > too. The pg_mv_statistic name seems to indicate multi columns, but how > about stats on date(datetime_column), or perhaps any non-volatile > function. This would help to solve the problem highlighted here > http://www.postgresql.org/message-id/CAApHDvp2vH=7O-gp-zAf7aWy+A-WHWVg7h3Vc6=5pf9Uf34DhQ@mail.gmail.com > . Without giving it too much thought, perhaps any expression that can be > indexed should be allowed to have stats? Would that be really difficult > to implement in comparison to what you've already done with the patch so > far? > I would not over-complicate requirements for the first version of this, I think it's already complicated enough. Quick look at the patch suggests that it mainly needs discussion about design and particular implementation choices, there is fair amount of TODOs and FIXMEs. I'd like to look at it too but I doubt that I'll have time to do in depth review in this CF. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, 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