From: | Andy Colson <andy(at)squeakycode(dot)net> |
---|---|
To: | AI Rumman <rummandba(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org |
Subject: | Re: query tuning help |
Date: | 2010-06-14 13:50:40 |
Message-ID: | 4C1633B0.8090101@squeakycode.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
On 06/14/2010 05:41 AM, AI Rumman wrote:
> Can any one please help me in tuning the query?
>
> explain
> select *
> from (select * from crmentity where deleted = 0 and createdtime between
> (now() - interval '6 month') and now() ) as crmentity
> inner join (select * from activity where activitytype = 'Emails' and
> date_start between (now() - interval '6 month') and now()) as activity
> on crmentity.crmid=activity.activityid
> inner join emaildetails on emaildetails.emailid = crmentity.crmid
> inner join vantage_email_track on
> vantage_email_track.mailid=emaildetails.emailid
> left join seactivityrel on seactivityrel.activityid = emaildetails.emailid
>
Can you send us 'explain analyze' too?
> -> Seq Scan on emaildetails (cost=0.00..1686.95 rows=44595 width=186)
> -> Seq Scan on vantage_email_track (cost=0.00..1324.52 rows=88852 width=12)
do you have indexes on emaildetails(emailid) and vantage_email_track(mailid)?
-Andy
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2010-06-14 13:59:33 | Re: Analysis Function |
Previous Message | Tom Molesworth | 2010-06-14 12:54:24 | Re: Dead lock |