Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 47F409FB4FB for ; Fri, 21 Sep 2007 16:11:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 17992-04 for ; Fri, 21 Sep 2007 16:11:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mx00.pub.collaborativefusion.com (mx00.pub.collaborativefusion.com [206.210.89.199]) by postgresql.org (Postfix) with ESMTP id C98D09F9816 for ; Fri, 21 Sep 2007 16:11:49 -0300 (ADT) Received: from vanquish.pitbpa0.priv.collaborativefusion.com (vanquish.pitbpa0.priv.collaborativefusion.com [192.168.2.61]) (SSL: TLSv1/SSLv3,256bits,AES256-SHA) by wingspan with esmtp; Fri, 21 Sep 2007 15:11:38 -0400 id 0005641E.46F4176A.00003815 Date: Fri, 21 Sep 2007 15:11:38 -0400 From: Bill Moran To: brauagustin-susc@yahoo.com.ar Cc: Kevin Grittner , pgsql-performance@postgresql.org Subject: Re: Low CPU Usage Message-Id: <20070921151138.b2c939fb.wmoran@collaborativefusion.com> In-Reply-To: <863435.2406.qm@web30014.mail.mud.yahoo.com> References: <863435.2406.qm@web30014.mail.mud.yahoo.com> Organization: Collaborative Fusion X-Mailer: Sylpheed 2.4.4 (GTK+ 2.10.14; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/382 X-Sequence-Number: 26927 In response to brauagustin-susc@yahoo.com.ar: > >> > That's not what it looks like based on the EXPLAIN ANALYZE output. > >> > It looks like run time dropped from two seconds to half a second. > >> > >> > It seems as though you either have a network delay delivering the results, > >> > or your application is slow to read them. > >> > >> > Exactly how are you arriving at those timings you're reporting to us? > >> > >> I have noticed this in a daly process I run which involves normally 45 minutes and with the new server takes 1:40. > >> > >> Some days ago I began to do some tests with no success, then I opened PgAdmin with this simply query to read 2 big tables and then compare disk access. > >> SELECT * > >> FROM fact_ven_renta fvr, dim_producto_std_producto dpp > >> WHERE > >> fvr.producto_std_producto_sk = dpp.producto_sk > >> > >> fact_ven_renta has 136316 rows > >> dim_producto_std_producto has 3669 rows > > >Run the tests from psql on the same server. As Kevin pointed out, the _server_ is faster, but it appears as if the connection between PGadmin and this new server is slower somehow. > > It runs quickly!!! But I don't know how to compare because looks like it retrieve fields by demand, when I put ctrl+end (go to the last record) it use a lot of CPU and disk, run quickly anyway. That's pretty odd. If you use \timing in psql, you can get execution time for each query, if it helps you track things down. > Correct me if am I wrong but, executing PgAdmin in the same server there aren't networks delays! Not network, no. But the results of your explains seem to show that the query is executing much faster on the new system than the old, so the problem still becomes, "what is happening after the query completes that is so slow?" It's just that networking is ruled out. -- Bill Moran Collaborative Fusion Inc. http://people.collaborativefusion.com/~wmoran/ wmoran@collaborativefusion.com Phone: 412-422-3463x4023