Re: Poor query performance on one of two "like" databases in production.

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Keaton_Adams(at)McAfee(dot)com
Cc: schmiddy(at)gmail(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: Poor query performance on one of two "like" databases in production.
Date: 2010-05-14 22:36:27
Message-ID: 20100514223627.GB21875@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

* Keaton_Adams(at)McAfee(dot)com (Keaton_Adams(at)McAfee(dot)com) wrote:
> It looks like it is just a difference in data volume. We are re-working the query to see what that will do.

Just my 2c, but I'd recommend using JOIN syntax instead of comma-joins.
eg:

select * from a JOIN b USING (col1,col2);

or:

select * from a JOIN b ON (a.col1 = b.col2);

Would make the query alot easier to read, imv. Also, those UNION ALLs
probably aren't really helping this whole situation.. Perhaps you could
move them out of the FROM clause and just have a simpler query for each
set which is *then* UNION ALL'd together.

THanks,

Stephen

Thanks,

Stephen

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joao Ferreira gmail 2010-05-14 22:59:49 Re: autovacuum: 50% iowait for hours
Previous Message Tom Lane 2010-05-14 22:34:14 Re: Persistence problem