slow "IN" clause - Mailing list pgsql-performance

From FavoYang@gmail.com
Subject slow "IN" clause
Date
Msg-id 1144640620.925899.274170@z34g2000cwc.googlegroups.com
Whole thread Raw
List pgsql-performance
I have a slow sql:
SELECT * FROM mytable WHERE id IN (1,3,5,7,....3k here...);
mytable is about 10k rows.

if don't use the "IN" clause, it will cost 0,11 second, otherwise it
will cost 2.x second
I guess pg use linear search to deal with IN clause, is there any way
to let pg use other search method with IN clause? (ex.Binary Search or
hash Search)


pgsql-performance by date:

Previous
From: "C Storm"
Date:
Subject: pgmemcache
Next
From: Vinko Vrsalovic
Date:
Subject: Re: slow "IN" clause