Re: How to optimize monstrous query, sorts instead of using index

От: Tom Lane
Тема: Re: How to optimize monstrous query, sorts instead of using index
Дата: ,
Msg-id: 4031.1056559177@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: Re: How to optimize monstrous query, sorts instead of using index  ("Michael Mattox")
Список: pgsql-performance

Скрыть дерево обсуждения

How to optimize monstrous query, sorts instead of using index  ("Michael Mattox", )
 Re: How to optimize monstrous query, sorts instead of using index  (Rod Taylor, )
  Re: How to optimize monstrous query, sorts instead of using index  ("Michael Mattox", )
   Re: How to optimize monstrous query, sorts instead of  (Rod Taylor, )
    Re: How to optimize monstrous query, sorts instead of  ("Michael Mattox", )
     Re: How to optimize monstrous query, sorts instead of  (Rod Taylor, )
      Re: How to optimize monstrous query, sorts instead of  ("Michael Mattox", )
       Re: How to optimize monstrous query, sorts instead of  (Rod Taylor, )
        Re: How to optimize monstrous query, sorts instead of  ("Michael Mattox", )
        Re: How to optimize monstrous query, sorts instead of  ("Michael Mattox", )
         Re: How to optimize monstrous query, sorts instead of  ("Michael Mattox", )
          Re: How to optimize monstrous query, sorts instead of  (Rod Taylor, )
           Re: How to optimize monstrous query, sorts instead of  ("Michael Mattox", )
         Re: How to optimize monstrous query, sorts instead of  (Rod Taylor, )
       Re: How to optimize monstrous query, sorts instead of  (SZUCS Gábor, )
      Re: How to optimize monstrous query, sorts instead of  (Tom Lane, )
   Re: How to optimize monstrous query, sorts instead of using index  (SZUCS Gábor, )
    Re: How to optimize monstrous query, sorts instead of using index  ("Michael Mattox", )
     Re: How to optimize monstrous query, sorts instead of using index  (Tom Lane, )

"Michael Mattox" <> writes:
> It's much slower but I appreciate you taking the time to try.  I'm pretty
> new to SQL so I must admin this query is very confusing for me.  I'm using
> Java Data Objects (JDO, an O/R mapping framework) but the implementation I'm
> using (Kodo) isn't smart enough to do all the joins efficiently, which is
> why I had to rewrite this query by hand.

It wasn't till I read that :-( that I noticed that you were doing nested
left joins.  Fooling with the join order may be your best route to a
solution --- have you read
http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=explicit-joins.html

            regards, tom lane


В списке pgsql-performance по дате сообщения:

От: Josh Berkus
Дата:
Сообщение: Re: Query running slower than same on Oracle
От: SZUCS Gábor
Дата:
Сообщение: Re: Similar querys, better execution time on worst execution plan