Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Re: Egroupware ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 3559 of 3799
Post > Topic >>

Re: Egroupware infolog query slow (includes query plan)

by tgl@[EMAIL PROTECTED] (Tom Lane) Jul 6, 2008 at 05:34 PM

Mark Stosberg <mark@[EMAIL PROTECTED]
> writes:
> I'm not skilled enough at reading the "Explain Analzyze" output to
> understand what the primary problem is. 

The problem is the repeated execution of the subquery in the SELECT
list; that's taking over 683 of the 686 seconds:

>                     SubPlan
>                       ->  Aggregate  (cost=2162.60..2162.61 rows=1
> width=0) (actual time=21.073..21.073 rows=1 loops=32424)
                                ^^^^^^              ^^^^^

The current formulation of the query guarantees that you can't do better
than a nestloop join with "sub" on the inside, and that nestloop isn't
even indexed.  See if you can convert it to a regular join instead of a
sub-select (probably with GROUP BY instead of DISTINCT).

Also, those LIKE conditions are just horrid: slow *and* unreadable.
Consider redesigning your data representation.  Perhaps converting
info_responsible to an int array would be reasonable.

			regards, tom lane

-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 3 Posts in Topic:
Egroupware infolog query slow (includes query plan)
mark@[EMAIL PROTECTED] (  2008-07-06 16:23:41 
Re: Egroupware infolog query slow (includes query plan)
mark@[EMAIL PROTECTED] (  2008-07-06 16:26:51 
Re: Egroupware infolog query slow (includes query plan)
tgl@[EMAIL PROTECTED] (T  2008-07-06 17:34:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 21:45:10 CST 2008.