Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiIsn-00052N-Sz for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Mar 2016 09:45:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aiIsn-00007b-Fa for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Mar 2016 09:45:49 +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 1aiIrQ-0005hd-FO for pgsql-hackers@postgresql.org; Tue, 22 Mar 2016 09:44:24 +0000 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1aiIrM-0005lx-WD for pgsql-hackers@postgresql.org; Tue, 22 Mar 2016 09:44:23 +0000 Received: by mail-wm0-x235.google.com with SMTP id p65so154866358wmp.0 for ; Tue, 22 Mar 2016 02:44:20 -0700 (PDT) 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=j54vePmU2R9IFtHFlbpd+FBq3dc276C4csiQkjYMhao=; b=UqoFLN+YAURLiB9+/GC2JPWBBfrudvYh9WU+LnItJhKd4nj+K4ltuqniz7t2e0b7aZ ahTB2s8wofDOuSzIlQ+EzWwaMsREQtzD+iuqCKg1D/I9zrm36E/+NOH3PX9Nc4Dkal0y BqqIh+xTTKJsgVbqbF9BM1UsNFzv/ZWiKTxBhflGVVOvcuXMFxgHhFh94zb8E5HNPt/Q 8P5TarVdG6DcgxTNXyEHM3OrDnRBIvBfVrnZKCWTQujXy7wmtfrQYpOYzy10bmAisHhR x9lHkXEEkw8YnkU+qVUO0g+zJlTDcr5tNHpEcp6QN8ZPk3gMjVkGI65rcqEbDTscNuVz NPHg== 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=j54vePmU2R9IFtHFlbpd+FBq3dc276C4csiQkjYMhao=; b=H4OFV7yVUvbl+ErDWEcZKHkr4Y8InZfBm+S9aQKz4kQzY62ozjD1NlG/Zmfx8Dz4sQ k9SfdENFyByBtZCAT0SuNm6x5tLoe74u+ov325/tTHjEgZQcH3ANlcFVUnQCKUZL9P80 ZaZQkdIjyqzD2ae9QwbCgRMlHJISck75JkdVZL+DUhY2QOcZzKZzpQLJE0i6PnmQnSvp YlGkzt/5DTT2UEutHLcJLW/HNSh+zQhgjWKIxo9e0xRSBfxWXUh9fB3oXzLqXRcrkGtY 2xgNYuikb5fEFj6CwRnD6fL+g+WeBlKohbqiiAblDsY+V6RIz9rNeK/z83qmFSaXPFOp qZjQ== X-Gm-Message-State: AD7BkJI2WLob1lrwJPBSQECCynZ4yOT2xCoE7W02tHwL2tH8AuovHZAL3c6xlj1ZTcfPmJtDsLeDeWkFp5+47fJDSAwpUIZXuPkHg+4i8GvBdESGe1hOfbYJstLAcIS15hRmtjXxqKlc8Tgdx2J71mFvg25QG1JSyyo+IzF7rkRchwEF56Qi4m375tTz0XywpSW6LjUWkrfZ X-Received: by 10.194.21.197 with SMTP id x5mr34287960wje.90.1458639858895; Tue, 22 Mar 2016 02:44:18 -0700 (PDT) Received: from [10.137.2.17] (ip-78-45-216-26.net.upcbroadband.cz. [78.45.216.26]) by smtp.gmail.com with ESMTPSA id v2sm16502170wmd.24.2016.03.22.02.44.17 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Mar 2016 02:44:18 -0700 (PDT) Subject: Re: multivariate statistics v14 To: Tatsuo Ishii References: <1457906378.27231.10.camel@2ndquadrant.com> <20160316.115824.1975980662850012690.t-ishii@sraoss.co.jp> <743161cc-771d-6e2b-c43f-4f2bd1fe6d42@2ndquadrant.com> <20160322.171330.803638245678985599.t-ishii@sraoss.co.jp> Cc: jeff.janes@gmail.com, alvherre@2ndquadrant.com, pgsql-hackers@postgresql.org From: Tomas Vondra Message-ID: <89341a68-4729-ad28-bb39-cef31849aedb@2ndquadrant.com> Date: Tue, 22 Mar 2016 10:44:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Thunderbird/46.0a2 MIME-Version: 1.0 In-Reply-To: <20160322.171330.803638245678985599.t-ishii@sraoss.co.jp> Content-Type: text/plain; charset=windows-1252; 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 Hello, On 03/22/2016 09:13 AM, Tatsuo Ishii wrote: >>> Do you have any other missing parts in this work? I am asking >>> because I wonder if you want to push this into 9.6 or rather 9.7. >> >> I think the first few parts of the patch series, namely: >> >> * shared infrastructure (0002) >> * functional dependencies (0003) >> * MCV lists (0004) >> * histograms (0005) >> >> might make it into 9.6. I believe the code for building and storing >> the different kinds of stats is reasonably solid. What probably needs >> more thorough review are the changes in clauselist_selectivity(), but >> the code in these parts is reasonably simple as it only supports using >> a single multi-variate statistics per relation. >> >> The part (0006) that allows using multiple statistics (i.e. selects >> which of the available stats to use and in what order) is probably the >> most complex part of the whole patch, and I myself do have some >> questions about some aspects of it. I don't think this part might get >> into 9.6 at this point (although it'd be nice if we managed to do >> that). > > Hum. So without 0006 or beyond, there's not much benefit for the > PostgreSQL users, and you are not too confident about 0006 or > beyond. Then I would think it is a little bit hard to justify in > putting 000[2-5] into 9.6. I really like this feature and would like > to see in PostgreSQL someday, but I'm not sure if we should put the > patches (0002-0005) into PostgreSQL now. Please let me know if there's > some reaons we should put the patches into PostgreSQL now. I don't think so. While being able to combine multiple statistics is certainly useful, I'm convinced that the initial patched add enough value on their own, even if the 0006 patch gets committed later. A lot of queries will be just fine with the "single multivariate statistics" limitation, either because it's using less than 8 columns, or because only 8 columns are actually correlated. (FWIW the 8 column limit is mostly arbitrary, it may get increased if needed.) I haven't really mentioned the aspects of 0006 that I think need more discussion, but it's mostly about the question whether combining the statistics by using the overlapping clauses as "conditions" is the right thing to do (or whether a more expensive approach is needed). None of that however invalidates the preceding patches. 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