Re: [SQL] slow 'IN' clause

2006-04-11 Thread Bruno Wolff III
On Sun, Apr 09, 2006 at 20:44:34 -0700, [EMAIL PROTECTED] wrote: > 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

[SQL] slow 'IN' clause

2006-04-10 Thread FavoYang
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 metho