X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 9EF559FA293 for ; Thu, 18 May 2006 11:52:48 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 03072-05-3 for ; Thu, 18 May 2006 11:52:37 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.rentalia.net (mail.rentalia.com [213.192.209.8]) by postgresql.org (Postfix) with ESMTP id 3BDF29F9C18 for ; Thu, 18 May 2006 11:52:37 -0300 (ADT) Received: (qmail 7444 invoked by uid 514); 18 May 2006 16:52:32 +0200 Received: from 62.37.217.203 by rigodon (envelope-from , uid 512) with qmail-scanner-1.25-st-qms (clamdscan: 0.88/1284. spamassassin: 3.0.2. perlscan: 1.25-st-qms. Clear:RC:0(62.37.217.203):SA:0(-2.2/5.0):. Processed in 4.817248 secs); 18 May 2006 14:52:32 -0000 X-Antivirus-MYDOMAIN-Mail-From: ruben@rentalia.com via rigodon X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:0(62.37.217.203):SA:0(-2.2/5.0):. Processed in 4.817248 secs Process 7095) Received: from 62-37-217-203.mad1.adsl.uni2.es (HELO ?192.168.2.28?) (ruben@rentalia.com@62.37.217.203) by mail.rentalia.net with SMTP; 18 May 2006 16:52:27 +0200 Message-ID: <446C8A27.9030100@rentalia.com> Date: Thu, 18 May 2006 16:52:23 +0200 From: Ruben Rubio Rey User-Agent: Mozilla Thunderbird 1.0.8 (X11/20060503) X-Accept-Language: en-us, en MIME-Version: 1.0 To: john_oshea@wordbank.com CC: pgsql-performance@postgresql.org Subject: Re: SQL CPU time usage References: <446B3F6A.9070205@rentalia.com> <25265881-37A8-4CD4-952F-3E7F4CE97F4D@wordbank.com> In-Reply-To: <25265881-37A8-4CD4-952F-3E7F4CE97F4D@wordbank.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/388 X-Sequence-Number: 19175 john_oshea@wordbank.com wrote: > On 17 May 2006, at 16:21, Ruben Rubio Rey wrote: > >> I have a web page, that executes several SQLs. >> >> So, I would like to know witch one of those SQLs consumes more CPU. >> For example, >> I have SQL1 that is executed in 1.2 secs and a SQL2 that is executed >> in 200 ms. >> >> But SQL2 is executed 25 times and SQL1 is executed 1 time, so really >> SQL2 consumes more CPU time. >> >> Is there any way to know this? >> I have think that logging all SQLs and then cheking it is a way to >> do it ... any other idea? > > > Practical Query Analysis: does > exactly that (scan historic logs). Very nice indeed and more than > worth the money (it's BSD-licensed) > thanks