slow 'IN' clause

Поиск
Список
Период
Сортировка
От FavoYang@gmail.com
Тема slow 'IN' clause
Дата
Msg-id 1144640674.181974.108190@u72g2000cwu.googlegroups.com
обсуждение исходный текст
Ответы Re: slow 'IN' clause  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-sql
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-sql по дате отправления:

Предыдущее
От: "chris smith"
Дата:
Сообщение: Re: [GENERAL] pgcrypto-crypt
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Special meaning of NL string