Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiIXF-00040h-Lv for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Mar 2016 09:23:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aiIXF-0003VI-3o for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Mar 2016 09:23:33 +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 1aiIXD-0003Ue-Qs for pgsql-hackers@postgresql.org; Tue, 22 Mar 2016 09:23:31 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1aiIXA-0005Mx-Tx for pgsql-hackers@postgresql.org; Tue, 22 Mar 2016 09:23:30 +0000 Received: by mail-wm0-x236.google.com with SMTP id r129so83276359wmr.1 for ; Tue, 22 Mar 2016 02:23:28 -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=xOl2VZRyJRXSqkbA1qTo0wGabKXV7zjJJp/G+BLacIs=; b=f7vDcddBdwIUgU0IfUbvah9q4welAxMJWAdJKHInnBCUsGoJQUqg7GqG1wZwPmqdOL oDRvDvmYZWyR3PBz2HyBX0v/LD1uleGgj3DH9Vme8A6XHAG+vnfyj3urC+Lhz7SkhQI/ 8fRcHSjQVhxApkQoj8thovZz9B332LngKYP5tWSiiTr/x0MR+s7rmmVAn4RxvnV3sNIJ 9tK9RThTkw+fI1GolWzoNPuP02rntEPxBZsneNOFQQ3+x25+gKyuvr2u3dmaULuH5G30 VGN0eQNq2g2FA5XFNA6nNXeHCCJ0uEyN/k8LJjWcJNU9YJj5VdX0gBjC1pu+/JOhsk9G Y6vw== 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=xOl2VZRyJRXSqkbA1qTo0wGabKXV7zjJJp/G+BLacIs=; b=bNuPErJVqn1A/tQ/d1dmqEmtEyHBVwspWHuawNBE87wiBHYvSn054I63wEfpKxk6bw wDGZ8xyWF0wjGVl9qgPXLOa19oaojkpbXes0jaPgl7zD2CLfBSTIH3b/VB3PMuqASwbW 6v/ziu4MBtgSvzWL9fH6sbb8P0s54kR/YqySB1EU7fU6j/AR5n5g1QLtKNbYyZAhXWRZ lMXdEcSi9GnwGkc8HwzmCUyWcKhWcnz33ph2Npp97hjeNoVZueoWqcZjXBhKprM7lsfP 5Bf9a0xV9PMY6PyOTeaP2BSjhPfZSBQq4FsoRmRFf7a/xJuhrgMHI82ee8WL6HuOszUJ 8JLQ== X-Gm-Message-State: AD7BkJK1GGnpdSy8QR+xp+HKq4rDvrI9qHuGg6lmhS6RBT7B2CU8ECYfNiEB2kqrrMWqNaNr8dOf1qqCV/sl2WrjKens26Umf0Jbe33SS/o2KraagYlFEE6H2x3csOJQ0N8mSI/hRr7Gscut+TBdoGJ2S45ImZEqK+TDkDXwl3KRm7mr586LbzlhxMGzJgklUdDm8adJqFGW X-Received: by 10.28.12.80 with SMTP id 77mr18747329wmm.19.1458638607338; Tue, 22 Mar 2016 02:23:27 -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 t82sm9965188wmt.17.2016.03.22.02.23.26 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Mar 2016 02:23:26 -0700 (PDT) Subject: Re: multivariate statistics v14 To: Jeff Janes References: <1457906378.27231.10.camel@2ndquadrant.com> <20160316.173111.82683171.horiguchi.kyotaro@lab.ntt.co.jp> <7aa6145f-302b-2077-b961-702cc61710bb@2ndquadrant.com> <20160321.080001.265512344372645105.t-ishii@sraoss.co.jp> <1bc2bd16-8e33-9e22-cdb1-9ddc38fedc4c@2ndquadrant.com> Cc: Tatsuo Ishii , Kyotaro HORIGUCHI , Alvaro Herrera , pgsql-hackers From: Tomas Vondra Message-ID: Date: Tue, 22 Mar 2016 10:23:23 +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: 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/22/2016 06:53 AM, Jeff Janes wrote: > On Sun, Mar 20, 2016 at 4:34 PM, Tomas Vondra > wrote: >> >> >> D'oh. Thanks for reporting. Attached is v16, hopefully fixing the few >> remaining whitespace issues. > > Hi Tomas, > > I'm trying out v16 against a common problem, where postgresql thinks > it is likely top stop early during a "order by (index express) limit > 1" but it doesn't actually stop early due to cross-column > correlations. But the multivariate statistics don't seem to help. Am > I doing this wrong, or just expecting too much? Yes, I think you're expecting a too much from the current patch. I've been thinking about perhaps addressing cases like this in the future, but it requires tracking position within the table somehow (e.g. by means of including ctid in the table, or something like that), and the current patch does not implement that. 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