Discussion:
Query Stuck in running server
(too old to reply)
Shams Khan
2012-11-15 07:27:06 UTC
Permalink
Hi,

There are few query I found at the time of monitoring below

00:54:43.574338 | 26952 | select a.actno,MAX(b.actid) as
actid,MAX(b.actname) as name,MAX(b.phone) as phone,MAX(b.email) as
mail,MAX(a.subsno) as subs,MAX(t.pkgid
) as svcid,MAX(a.expirydt) as expirydt,MAX(d.domid) as
domid,MAX(d.domname) as domname from actbal a inner join subs s on
a.subsno=s.subsno inner join packages t on s.svcno=t.pkgno inner join
account b on b.actno=a.actno inner join ssgdom d on b.domno=d.domno where
a.actno not in ( select a.actno from actbal a inner join subs s on
a.actno=s.actno where s.status <= 15 and a.expirydt > $1) and a.expirydt
<= $2 and b.domno=$ group by a.actno order by MAX(d.domname),MAX(b.actname)

can somebody help me to understand it
Albe Laurenz
2012-11-15 08:54:47 UTC
Permalink
Post by Shams Khan
There are few query I found at the time of monitoring below
00:54:43.574338 | 26952 | select a.actno,MAX(b.actid) as
actid,MAX(b.actname) as name,MAX(b.phone)
Post by Shams Khan
as phone,MAX(b.email) as mail,MAX(a.subsno) as subs,MAX(t.pkgid
) as svcid,MAX(a.expirydt) as expirydt,MAX(d.domid) as
domid,MAX(d.domname) as domname from actbal a
Post by Shams Khan
inner join subs s on a.subsno=s.subsno inner join packages t on
s.svcno=t.pkgno inner join account b
Post by Shams Khan
on b.actno=a.actno inner join ssgdom d on b.domno=d.domno where
a.actno not in ( select a.actno from
Post by Shams Khan
actbal a inner join subs s on a.actno=s.actno where s.status <= 15 and
a.expirydt > $1) and
Post by Shams Khan
a.expirydt <= $2 and b.domno=$ group by a.actno order by
MAX(d.domname),MAX(b.actname)
Post by Shams Khan
can somebody help me to understand it
Understand what? What is the problem?

Yours,
Laurenz Albe
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Shams Khan
2012-11-15 09:11:34 UTC
Permalink
Whenever the load of server increases, I find this query running in which
seems to me the reason. Is there any other way I can written in such a way
so that it doesn't hang up the entire process?
Post by Shams Khan
Post by Shams Khan
There are few query I found at the time of monitoring below
00:54:43.574338 | 26952 | select a.actno,MAX(b.actid) as
actid,MAX(b.actname) as name,MAX(b.phone)
Post by Shams Khan
as phone,MAX(b.email) as mail,MAX(a.subsno) as subs,MAX(t.pkgid
) as svcid,MAX(a.expirydt) as expirydt,MAX(d.domid) as
domid,MAX(d.domname) as domname from actbal a
Post by Shams Khan
inner join subs s on a.subsno=s.subsno inner join packages t on
s.svcno=t.pkgno inner join account b
Post by Shams Khan
on b.actno=a.actno inner join ssgdom d on b.domno=d.domno where
a.actno not in ( select a.actno from
Post by Shams Khan
actbal a inner join subs s on a.actno=s.actno where s.status <= 15 and
a.expirydt > $1) and
Post by Shams Khan
a.expirydt <= $2 and b.domno=$ group by a.actno order by
MAX(d.domname),MAX(b.actname)
Post by Shams Khan
can somebody help me to understand it
Understand what? What is the problem?
Yours,
Laurenz Albe
Albe Laurenz
2012-11-15 09:59:24 UTC
Permalink
Post by Shams Khan
Whenever the load of server increases, I find this query running in
which seems to me the reason. Is
Post by Shams Khan
there any other way I can written in such a way so that it doesn't
hang up the entire process?

Oh, I see. Try to follow
http://wiki.postgresql.org/wiki/Slow_Query_Questions
if you want to receive a meaningful answer.

Yours,
Laurenz Albe
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Loading...