Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group