| От | Tom Lane |
|---|---|
| Тема | Re: Performance problem with semi-large tables |
| Дата | |
| Msg-id | 3657.1107107402@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Performance problem with semi-large tables (PFC <lists@boutiquenumerique.com>) |
| Список | pgsql-performance |
PFC <lists@boutiquenumerique.com> writes:
>> For example, let's add another filter to get all the shipments with
>> release code '5' that are 7 days old or newer.
>>
>> ss.date >= current_date - 7
> It's the order by + limit which makes the query behaves badly, and which
> forces use of kludges to use the index. If you add another condition like
> that, it should be a breeze.
Actually, that date condition has its own problem, namely that the
compared-to value isn't a constant. The 8.0 planner is able to realize
that this is a pretty selective condition, but prior releases fall back
on a very pessimistic default estimate. I'm sure that has something to
do with Ken not being able to get it to use an index on date.
regards, tom lane
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера