| От | Tom Lane |
|---|---|
| Тема | Re: Costly "Sort Key" on indexed timestamp column |
| Дата | |
| Msg-id | 14020.1094789831@sss.pgh.pa.us обсуждение |
| Ответ на | Costly "Sort Key" on indexed timestamp column (<ogjunk-pgjedan@yahoo.com>) |
| Список | pgsql-performance |
<ogjunk-pgjedan@yahoo.com> writes: > I'm tuning my PostgreSQL DB (7.3.4) and have come across a query that > doesn't use an index I created specially for it, and consequently takes > circa 2 seconds to run. :( > ... > The output of EXPLAIN ANALYZE follows. Note how 99% of the total cost > comes from "Sort Key: userinfo1_.create_date". No, you are misreading the output. 99% of the cost comes from the join steps. I think the problem is that you have forced a not-very-appropriate join order by use of INNER JOIN syntax, and so the plan is creating intermediate join outputs that are larger than they need be. See http://www.postgresql.org/docs/7.3/static/explicit-joins.html 7.4 is a bit more forgiving about this; compare http://www.postgresql.org/docs/7.4/static/explicit-joins.html regards, tom lane
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера