Re: Planning large IN lists
От | Bruce Momjian |
---|---|
Тема | Re: Planning large IN lists |
Дата | |
Msg-id | 200705141811.l4EIB0125540@momjian.us обсуждение исходный текст |
Ответ на | Re: Planning large IN lists (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
Is this a TODO? --------------------------------------------------------------------------- Tom Lane wrote: > 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 7: You can help support the PostgreSQL project by donating at > > http://www.postgresql.org/about/donate -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +
В списке pgsql-hackers по дате отправления: