Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id D89B747589D for ; Wed, 15 May 2002 09:16:37 -0400 (EDT) Received: from mail-relay.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by postgresql.org (Postfix) with SMTP id E465D475452 for ; Wed, 15 May 2002 09:16:25 -0400 (EDT) Received: (qmail 3147 invoked from network); 15 May 2002 13:10:34 -0000 Received: from system29.trade-india-local.com (HELO server) (192.168.0.29) by ptil-236-129-del.primus-india.net with SMTP; 15 May 2002 13:10:34 -0000 Content-Type: text/plain; charset="iso-8859-1" From: "Rajesh Kumar Mallah." (by way of Rajesh Kumar Mallah. ) Organization: Infocom Network Limited. Subject: Immortal backend .... (kill -9 ?..) Date: Wed, 15 May 2002 18:46:05 +0530 X-Mailer: KMail [version 1.4] To: pgsql-admin MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200205151846.05259.mallah@trade-india.com> X-Archive-Number: 200205/127 X-Sequence-Number: 4302 Hi i have just discovered a query in my database system that would take extremely long durations to finish. the query plan is like: explain SELECT source_id , cnt from (SELECT source_id,count(source_id) as cnt from email_source group by source_id ) subsel join sources using(source_id) order by source_id tradein_clients-# ; NOTICE: QUERY PLAN: Merge Join (cost=3D145610.94..147300.41 rows=3D112596 width=3D16) -> Sort (cost=3D145597.57..145597.57 rows=3D112596 width=3D4) -> Subquery Scan subsel (cost=3D130520.56..136150.35 rows=3D112596 width=3D4) -> Aggregate (cost=3D130520.56..136150.35 rows=3D112596 width= =3D4) ->=20 Group (cost=3D130520.56..133335.46 rows=3D1125957 width=3D4) -> Sort=20 (cost=3D130520.56..130520.56 rows=3D1125957 width=3D4) -> Seq Scan on email_source (cost=3D0.00..17346.57 rows=3D1125957 width=3D4) -> Sort=20 (cost=3D13.37..13.37 rows=3D213 width=3D4) -> Seq Scan on sources (cost=3D0.00..5.13 rows=3D213 width=3D4) EXPLAIN unfortunately it has been running since yesterday and i am discovering it now. now even kill -9 does not releases it below is the current status of backends: postgres 8594 0.0 0.0 139416 148 ? S May11 0:25 /usr/local/pgsql/bin/postmaster postgres 8595 1.3 0.1 140408 1040 ?=20= =20=20=20=20=20 S May11 78:47 postgres: stats buffer process postgres 8597 1.1 0.0 139704 324 ? S May11 65:18 postgres: stats collector process postgres 32444 0.0 0.0 238700 0 ? DW May14 0:20 postgres: tradein tradein_clients 130.94.20.27 SELECT postgres 32482 0.0 0.0 13980= 8=20 0 ? DW May14 0:00 postgres: checkpoint subprocess postgres 169= 07 0.0 0.3 140296 3912 ? S 17:51 0:00 postgres: postgres tradein_clients 203.196.129.235 idle postgres 20382 1.3 4.1 140816 42588= ? S 18:27 0:01 postgres: tradein tradein_clients 130.94.20.27 idle in transaction postgres 20388 0.5 6.7 141200 68940 ? S 18:27=20= =20 0:00 postgres: tradein tradein_clients 130.94.20.27 idle in transaction The pid of the backend that is executing the query is 32444 . also note that pid 32482 is also (running?) is since may 14 and 32444 also is (running?) since may 14. (is there any relation between them?) what is checkpoint subprocess? the load average is [root@linux10320 root2]# uptime 6:30pm up 4 days, 6:26, 1 user, load average: 11.08, 10.54, 10.78 [root@linux10320 root2]# can anyone tell me what might me causing so much load in the system, or someway to get see what is going on to make such a load? also if i were to bring down postgresql what should have been a safe (and effective) way. Disk I/O is like: # iostat -d 2 6 Linux 2.4.9 (linux10320) 05/15/02 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn dev8-0 32.25 450.01 445.92 166025844 164517760 dev8-1 34.26 434.75 640.21 160395794 236199552 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn dev8-0 2.50 24.00 12.00 48 24 dev8-1 1.00 0.00 12.00 0 24 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn dev8-0 13.00 0.00 112.00 0 224 dev8-1 13.00 0.00 112.00 0 224 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn dev8-0 23.50 0.00 200.00 0 400 dev8-1 23.50 0.00 200.00 0 400 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn dev8-0 3.00 0.00 44.00 0 88 dev8-1 3.00 0.00 44.00 0 88 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn dev8-0 3.00 0.00 36.00 0 72 dev8-1 3.00 0.00 36.00 0 72 [root@linux10320 root2]# Regds Mallah. -- Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)6152172 (221) (L) ,9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace.