Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XjRJY-0007i1-58 for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Oct 2014 11:21:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XjRJW-00075k-QT for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Oct 2014 11:21:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XjRJV-00075e-Et for pgsql-hackers@postgresql.org; Wed, 29 Oct 2014 11:21:17 +0000 Received: from smtp-out1.gransy.com ([77.78.126.51]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XjRJR-0003od-7q for pgsql-hackers@postgresql.org; Wed, 29 Oct 2014 11:21:16 +0000 Received: from smtp-out.gransy.com (localhost [127.0.0.1]) by smtp-out1.gransy.com (Postfix) with ESMTP id 6562336007D for ; Wed, 29 Oct 2014 12:21:10 +0100 (CET) Received: from smtp.gransy.com (smtp.simplia.cz [77.78.126.20]) by smtp-out1.gransy.com (Postfix) with ESMTP id 1F5FA360005; Wed, 29 Oct 2014 12:21:10 +0100 (CET) Received: from 2.emaily.eu (elizabeth.gransy.com [89.187.132.199]) (Authenticated sender: tv@fuzzy.cz) by smtp.gransy.com (Postfix) with ESMTPA id D97A619A0231; Wed, 29 Oct 2014 12:21:06 +0100 (CET) Received: from 212.47.19.46 (SquirrelMail authenticated user tv@fuzzy.cz) by 2.emaily.eu with HTTP; Wed, 29 Oct 2014 12:21:08 +0100 Message-ID: <32d9bff1ca469f85d6fd3ad5db1237b2.squirrel@2.emaily.eu> In-Reply-To: References: <543AFA15.4080608@fuzzy.cz> Date: Wed, 29 Oct 2014 12:21:08 +0100 Subject: Re: WIP: multivariate statistics / proof of concept From: "Tomas Vondra" To: "David Rowley" Cc: "Tomas Vondra" , "PostgreSQL-development" User-Agent: SquirrelMail/1.4.22 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal 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 Dne 29 Říjen 2014, 10:41, David Rowley napsal(a): > > 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 don't know, but it seems mostly orthogonal to what the patch aims to do. If we add collecting statistics on expressions (on a single column), then I'd expect it to be reasonably simple to add this to the multi-column case. There are features like join stats or range type stats, that are probably more directly related to the patch (but out of scope for the initial version). > I'm quite interested in reviewing your work on this, but it appears that > some of your changes are not C89: > > src\backend\commands\analyze.c(3774): error C2057: expected constant > expression [D:\Postgres\a\postgres.vcxproj] > src\backend\commands\analyze.c(3774): error C2466: cannot allocate an > array of constant size 0 [D:\Postgres\a\postgres.vcxproj] > src\backend\commands\analyze.c(3774): error C2133: 'indexes' : unknown > size [D:\Postgres\a\postgres.vcxproj] > src\backend\commands\analyze.c(4302): error C2057: expected constant > expression [D:\Postgres\a\postgres.vcxproj] > src\backend\commands\analyze.c(4302): error C2466: cannot allocate an > array of constant size 0 [D:\Postgres\a\postgres.vcxproj] > src\backend\commands\analyze.c(4302): error C2133: 'ndistincts' : unknown > size [D:\Postgres\a\postgres.vcxproj] > src\backend\commands\analyze.c(4775): error C2057: expected constant > expression [D:\Postgres\a\postgres.vcxproj] > src\backend\commands\analyze.c(4775): error C2466: cannot allocate an > array of constant size 0 [D:\Postgres\a\postgres.vcxproj] > src\backend\commands\analyze.c(4775): error C2133: 'keys' : unknown size > [D:\Postgres\a\postgres.vcxproj] > > The compiler I'm using is a bit too stupid to understand the C99 syntax. > > I guess you'd need to palloc() these arrays instead in order to comply > with > the project standards. > > http://www.postgresql.org/docs/devel/static/install-requirements.html > > I'm going to sign myself up to review this, so probably my first feedback > would be the compiling problem. I'll look into that. The thing is I don't have access to MSVC, so it's a bit difficult to spot / fix those issues :-( regards Tomas -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers