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 5BF339FA226 for ; Wed, 17 May 2006 12:21:38 -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 36294-04 for ; Wed, 17 May 2006 12:21:29 -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 DEC749F9C18 for ; Wed, 17 May 2006 12:21:27 -0300 (ADT) Received: (qmail 30874 invoked by uid 514); 17 May 2006 17:21:23 +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.833894 secs); 17 May 2006 15:21:23 -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.833894 secs Process 30806) 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; 17 May 2006 17:21:18 +0200 Message-ID: <446B3F6A.9070205@rentalia.com> Date: Wed, 17 May 2006 17:21:14 +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: pgsql-performance@postgresql.org Subject: SQL CPU time usage 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/361 X-Sequence-Number: 19148 Hi, 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? Thanks in advance