Strange behaviour of SELECT ... IN

From: Jorge Sarmiento <jsarmiento(at)ccom(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Strange behaviour of SELECT ... IN
Date: 2002-06-26 13:39:04
Message-ID: 200206260939.04396.jsarmiento@ccom.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

when I do a:

explain select * from table1 where name in ('JORGE');

NOTICE: QUERY PLAN:

Index Scan using idx_table1 on table (cost=0.00..10901.87 rows=3184 width=48)

but if do a:

explain select * from table1 where name in ('JORGE', 'JUAN', 'JOSE');

NOTICE: QUERY PLAN:

Seq Scan on table1 (cost=0.00..16689.73 rows=9506 width=48)

why??? is there any way to make postgresql use index in the second type of
query?

thnx!

Jorge S.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Johnson, Shaunn 2002-06-26 14:01:12 How to run multi-processor question
Previous Message Laurent Savary 2002-06-26 13:32:29 PostGreSql ODBC driver and Powerbuilder 7.0.3 problem