pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedSQL CPU time usage
4+ messages / 3 participants
[nested] [flat]
* SQL CPU time usage
@ 2006-05-17 15:21 Ruben Rubio Rey <ruben@rentalia.com>
0 siblings, 2 replies; 4+ messages in thread
From: Ruben Rubio Rey @ 2006-05-17 15:21 UTC (permalink / raw)
To: pgsql-performance
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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: SQL CPU time usage
@ 2006-05-17 16:18 john_oshea@wordbank.com
parent: Ruben Rubio Rey <ruben@rentalia.com>
1 sibling, 1 reply; 4+ messages in thread
From: john_oshea@wordbank.com @ 2006-05-17 16:18 UTC (permalink / raw)
To: pgsql-performance
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: <http://pqa.projects.postgresql.org/; does
exactly that (scan historic logs). Very nice indeed and more than
worth the money (it's BSD-licensed)
--
John O'Shea
Wordbank Limited
33 Charlotte Street, London W1T 1RR
Direct line: +44 (0) 20 7903 8829
Fax: +44 (0) 20 7903 8888
<http://www.wordbank.com/;
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: SQL CPU time usage
@ 2006-05-18 14:52 Ruben Rubio Rey <ruben@rentalia.com>
parent: john_oshea@wordbank.com
0 siblings, 0 replies; 4+ messages in thread
From: Ruben Rubio Rey @ 2006-05-18 14:52 UTC (permalink / raw)
To: john_oshea@wordbank.com; +Cc: pgsql-performance
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: <http://pqa.projects.postgresql.org/; does
> exactly that (scan historic logs). Very nice indeed and more than
> worth the money (it's BSD-licensed)
>
thanks
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: SQL CPU time usage
@ 2006-05-18 16:01 Ivan Zolotukhin <ivan.zolotukhin@gmail.com>
parent: Ruben Rubio Rey <ruben@rentalia.com>
1 sibling, 0 replies; 4+ messages in thread
From: Ivan Zolotukhin @ 2006-05-18 16:01 UTC (permalink / raw)
To: Ruben Rubio Rey <ruben@rentalia.com>; +Cc: pgsql-performance
You may also try PgFouine (http://pgfouine.projects.postgresql.org/)
for log analysis, I found it very useful in similar situation.
On 5/17/06, Ruben Rubio Rey <ruben@rentalia.com> wrote:
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2006-05-18 16:01 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-05-17 15:21 SQL CPU time usage Ruben Rubio Rey <ruben@rentalia.com>
2006-05-17 16:18 ` john_oshea@wordbank.com
2006-05-18 14:52 ` Ruben Rubio Rey <ruben@rentalia.com>
2006-05-18 16:01 ` Ivan Zolotukhin <ivan.zolotukhin@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox