Re: Introducing floating point cast into filter drastically changes row estimate
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Introducing floating point cast into filter drastically changes row estimate |
| Дата | |
| Msg-id | 6962.1351106799@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Introducing floating point cast into filter drastically changes row estimate (Merlin Moncure <mmoncure@gmail.com>) |
| Ответы |
Re: Introducing floating point cast into filter drastically
changes row estimate
|
| Список | pgsql-bugs |
Merlin Moncure <mmoncure@gmail.com> writes:
> The following query runs fine: it estimates the returned rows pretty wel:
> postgres=# explain analyze select * from foo where i > 100 and i < 10000;
> ...but if you introduce a floating point cast, it drastically changes
> the returned rows (why?):
> postgres=# explain analyze select * from foo where i::float8 > 100
> and i::float8 < 10000;
The planner has stats about "i", but none about "i::float8", so you're
getting a default estimate in the second case. It does, however,
realize that you're applying a range restriction condition to
"i::float8", and the default selectivity estimate for that is
intentionally pretty small.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера