Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aJLyH-0007Ng-MP for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Jan 2016 14:00:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aJLyH-0007e8-95 for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Jan 2016 14:00:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aJLwx-0005zB-AY for pgsql-hackers@postgresql.org; Wed, 13 Jan 2016 13:58:59 +0000 Received: from newmail.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aJLwt-0006Lf-Bu for pgsql-hackers@postgresql.org; Wed, 13 Jan 2016 13:58:58 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id F1A7421C57C8; Wed, 13 Jan 2016 16:58:53 +0300 (MSK) Received: from mail.postgrespro.ru ([127.0.0.1]) by localhost (mail.postgrespro.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 44O7T8ePpI6C; Wed, 13 Jan 2016 16:58:52 +0300 (MSK) Received: from [192.168.27.79] (unknown [192.168.27.1]) by mail.postgrespro.ru (Postfix) with ESMTPSA id 6CF0F21C5764; Wed, 13 Jan 2016 16:58:52 +0300 (MSK) Subject: Re: WIP: Covering + unique indexes. To: David Rowley References: <56167F09.3090101@postgrespro.ru> <56168952.4010101@postgrespro.ru> <5617DAA3.6080408@postgrespro.ru> <565D9859.3040405@postgrespro.ru> <569530FC.2010900@postgrespro.ru> Cc: Jeff Janes , PostgreSQL-development From: Anastasia Lubennikova Message-ID: <56965808.7050004@postgrespro.ru> Date: Wed, 13 Jan 2016 16:58:32 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.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: -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 13.01.2016 04:27, David Rowley: > I've also done some testing: > > create table ab (a int, b int); > insert into ab select a,b from generate_Series(1,10) a(a), > generate_series(1,10000) b(b); > set enable_bitmapscan=off; > set enable_indexscan=off; > > select * from ab where a = 1 and b=1; > a | b > ---+--- > 1 | 1 > (1 row) > > set enable_indexscan = on; > select * from ab where a = 1 and b=1; > a | b > ---+--- > (0 rows) > > This is broken. I've not looked into why yet, but from looking at the > EXPLAIN output I was a bit surprised to see b=1 as an index condition. > I'd have expected a Filter maybe, but I've not looked at the EXPLAIN > code to see how those are determined yet. Hmm... Do you use both patches? And could you provide index definition, I can't reproduce the problem assuming that index is created by the statement CREATE INDEX idx ON ab (a) INCLUDING (b); -- Anastasia Lubennikova Postgres Professional: http://www.postgrespro.com The Russian Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers