Re: Planning large IN lists

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Planning large IN lists
Дата
Msg-id 19001.1178823208@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Planning large IN lists  (Neil Conway <neilc@samurai.com>)
Ответы Re: Planning large IN lists  ("Dann Corbit" <DCorbit@connx.com>)
Re: Planning large IN lists  (Bruce Momjian <bruce@momjian.us>)
Re: Planning large IN lists  ("Atul Deopujari" <atul.deopujari@enterprisedb.com>)
Re: Planning large IN lists  ("Atul Deopujari" <atuld@enterprisedb.com>)
Список pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> When planning queries with a large IN expression in the WHERE clause,
> the planner transforms the IN list into a scalar array expression. In
> clause_selectivity(), we estimate the selectivity of the ScalarArrayExpr
> by calling scalararraysel(), which in turn estimates the selectivity of
> *each* array element in order to determine the selectivity of the array
> expression as a whole.

> This is quite inefficient when the IN list is large.

That's the least of the problems.  We really ought to convert such cases
into an IN (VALUES(...)) type of query, since often repeated indexscans
aren't the best implementation.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Lukas Kahwe Smith
Дата:
Сообщение: Re: Planning large IN lists
Следующее
От: "Dann Corbit"
Дата:
Сообщение: Re: Planning large IN lists