| От | Tom Lane |
|---|---|
| Тема | Re: Wrong index choosen? |
| Дата | |
| Msg-id | 20162.1090593927@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Wrong index choosen? (Dennis Bjorklund <db@zigo.dhs.org>) |
| Список | pgsql-hackers |
Dennis Bjorklund <db@zigo.dhs.org> writes:
> In this plan it estimates to get 481 but it got 22477. So the estimation
> was very wrong. You can increase the statistics tarhet on the login_time
> and it will probably be better (after the next analyze).
Given the nature of the data (login times), I'd imagine that the problem
is simply that he hasn't analyzed recently enough. A bump in stats
target may not be needed, but he's going to have to re-analyze that
column often if he wants this sort of query to be estimated accurately,
because the fraction of entries later than a given time T is *always*
going to be changing.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера