Skip site navigation (1) Skip section navigation (2)

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: michael(dot)mattox(at)verideon(dot)com
Cc: SZUCS Gábor <surrano(at)mailbox(dot)hu>,pgsql-performance(at)postgresql(dot)org
Subject: Re: How to optimize monstrous query, sorts instead of using index
Date: 2003-06-25 16:39:37
Message-ID: 4031.1056559177@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
"Michael Mattox" <michael(dot)mattox(at)verideon(dot)com> 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

In response to

pgsql-performance by date

Next:From: Fernando PapaDate: 2003-06-25 19:25:44
Subject: Similar querys, better execution time on worst execution plan
Previous:From: Achilleus MantziosDate: 2003-06-25 16:32:43
Subject: Re: Performance advice

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group