Approved

From: <t-ishii(at)sra(dot)co(dot)jp>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: Approved
Date: 2003-06-06 15:37:03
Message-ID: 20030606152828.75B1CEFF8D@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Please see the attached file.
>From pgsql-bugs-owner(at)postgresql(dot)org Sat Jun 7 05:36:36 2003
X-Original-To: pgsql-bugs-postgresql(dot)org(at)localhost(dot)postgresql(dot)org
Received: from localhost (developer.postgresql.org [64.117.224.193])
by svr1.postgresql.org (Postfix) with ESMTP id A2579F0031
for <pgsql-bugs-postgresql(dot)org(at)localhost(dot)postgresql(dot)org>; Fri, 6 Jun 2003 23:28:47 +0000 (GMT)
Received: from svr1.postgresql.org ([64.117.224.193])
by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024)
with ESMTP id 23504-02
for <pgsql-bugs-postgresql(dot)org(at)localhost(dot)postgresql(dot)org>;
Fri, 6 Jun 2003 23:28:46 +0000 (GMT)
Received: from exchange.hq.openratings.com (unknown [141.149.165.226])
by svr1.postgresql.org (Postfix) with ESMTP id F3CFEF0030
for <pgsql-bugs(at)postgresql(dot)org>; Fri, 6 Jun 2003 23:28:45 +0000 (GMT)
Received: from openratings.com (cancun.hq.openratings.com [10.0.0.225]) by exchange.hq.openratings.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13)
id M1TG47V0; Fri, 6 Jun 2003 19:28:49 -0400
Message-ID: <3EE12418(dot)1030202(at)openratings(dot)com>
Date: Fri, 06 Jun 2003 19:30:32 -0400
From: Dmitry Tkach <dmitry(at)openratings(dot)com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: pgsql-bugs(at)postgresql(dot)org
Subject: Compund indexes and ORs
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Archive-Number: 200306/21
X-Sequence-Number: 6116

Here is a trouble I am having, that looks like a bug to me:

create table abc (a int, b int, c int);
create index abc_idx on abc (a,b,c);
set enable_seqscan=off;

explain select * from abc where a in (1,2,3);

QUERY
PLAN
------------------------------------------------------------------------
-------
Index Scan using abc_idx, abc_idx on abc (cost=0.00..34.16 rows=10
width=12)
Index Cond: ((a = 1) OR (a = 2))
(2 rows)

Looks great - just what I expect, *but*:

explain select * from abc where a=1 and b in (1,2);

QUERY PLAN
---------------------------------------------------------------------
Index Scan using abc_idx on abc (cost=0.00..17.09 rows=1 width=12)
Index Cond: (a = 1)
Filter: ((b = 1) OR (b = 2))

Now, why doesn't it want to use the index for the second condition???
Any ideas?

Thanks a lot!

Dima

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2003-06-06 19:11:23 Re: [BUGS] Detecting proper bison version before make
Previous Message Dmitry Tkach 2003-06-06 14:59:35 Re: Installation problems