| От | Tom Lane |
|---|---|
| Тема | Re: sunquery and estimated rows |
| Дата | |
| Msg-id | 3802.1082159101@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | sunquery and estimated rows (Litao Wu <litaowu@yahoo.com>) |
| Ответы |
Re: sunquery and estimated rows
|
| Список | pgsql-performance |
Litao Wu <litaowu@yahoo.com> writes:
> When I included a subquery, the estimated rows (1240)
> is way too high as shown in the following example.
> select * from test
> where scope=(select 10);
The planner sees that as "where scope = <some complicated expression>"
and falls back to a default estimate. It won't simplify a sub-select
to a constant. (Some people consider that a feature ;-).)
The estimate should still be derived from the statistics for the
scope column, but it will just depend on the number of distinct
values for the column and not on the specific comparison constant.
regards, tom lane
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера