Strange behaviour of SELECT ... IN - Mailing list pgsql-general

From Jorge Sarmiento
Subject Strange behaviour of SELECT ... IN
Date
Msg-id 200206260939.04396.jsarmiento@ccom.org
Whole thread Raw
Responses Re: Strange behaviour of SELECT ... IN  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List 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.



pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: unlimited undo/journaling
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Still problems with memory swapping and server load