Re: Slow query
| От | Tom Lane |
|---|---|
| Тема | Re: Slow query |
| Дата | |
| Msg-id | 20749.1048543730@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Slow query (Oleg Lebedev <oleg.lebedev@waterford.org>) |
| Список | pgsql-performance |
Oleg Lebedev <oleg.lebedev@waterford.org> writes:
> I just ran the query you sent me and attached the output of EXPLAIN
> ANALYZE as TOMs_plan.txt
> It did not speed up the query significantly.
Nope. I was hoping to see a faster-start plan, but given the number of
rows involved I guess it won't change its mind. You're going to have to
think about a more intelligent approach, rather than minor tweaks.
One question: since objectid is evidently a primary key, why are you
doing a subselect for the first part? Wouldn't it give the same result
just to say "m.activity = '347667'" in the top-level WHERE?
As for the second part, I think you'll have to try to rewrite it as a
join with the media table.
regards, tom lane
В списке pgsql-performance по дате отправления: