pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@postnewspapers.com.au>
To: Srikanth <srikanth@inventum.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: What is the best way to optimize the query.
Date: Mon, 19 Jul 2010 14:08:43 +0800
Message-ID: <4C43EBEB.8070704@postnewspapers.com.au> (raw)
In-Reply-To: <4C416ED2.4000008@inventum.net>
References: <4C416ED2.4000008@inventum.net>

On 17/07/10 16:50, Srikanth wrote:
> I am sending u the query along with execution plan. Please help
> 
> explain analyze select
> s.*,a.actid,a.phone,d.domid,d.domname,d.domno,a.actno,a.actname,p.descr
> as svcdescr
> from vwsubsmin s
> inner join packages p on s.svcno=p.pkgno
> inner join account a on a.actno=s.actno
> inner join ssgdom d on a.domno=d.domno
> inner join (select subsno from getexpiringsubs(1,cast(2 as
> integer),cast(3 as double precision),
> '4') as (subsno int,expirydt timestamp without time zone,balcpt double
> precision)) as e
> on s.subsno=e.subsno
> where s.status <=15 and d.domno=273
> order by d.domname,s.expirydt,a.actname


Lots of those names in the join list are views, aren't they?

I doubt anyone can help you unless you show the definition of your views
and the schema of your tables.

Also, consider attaching the EXPLAIN ANALYZE output as a text
attachment, as your mail client is "helpfully" rewrapping it into
unintelligible gibberish.

--
Craig Ringer



view thread (4+ messages)  latest in thread

Message-ID: <4C43EBEB.8070704@postnewspapers.com.au>
Permalink:  ../4C43EBEB.8070704@postnewspapers.com.au/
Also on:    postgresql.org/message-id/4C43EBEB.8070704@postnewspapers.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: craig@postnewspapers.com.au, srikanth@inventum.net
  Subject: Re: What is the best way to optimize the query.
  In-Reply-To: <4C43EBEB.8070704@postnewspapers.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox