Hi,

In postgres, is there a way to get the CPU time and I/O time taken (separately)
to execute a query? Does the profile info. help in some way to 
calculate the CPU/IO break up at least approximately.

What is the best way to do it? Any kind of help is greatly appreciated.

Thanks
--shiby



Wed, 04 Mar 1998 17:56:37 -0500
Shiby Thomas <sthomas@cise.ufl.edu>
Execution time
Shiby Thomas wrote:
> 
> Hi,
> 
> In postgres, is there a way to get the CPU time and I/O time taken (separately)
> to execute a query? Does the profile info. help in some way to
> calculate the CPU/IO break up at least approximately.
> 
> What is the best way to do it? Any kind of help is greatly appreciated.
> 
> Thanks
> --shiby

How about running "time postgres ..." and connecting to the backend
without using the postmaster?

/* m */

Fri, 06 Mar 1998 11:47:23 +0100
Mattias Kregert <matti@algonet.se>
Re: [HACKERS] Execution time

=> How about running "time postgres ..." and connecting to the backend
=> without using the postmaster?
=> 
The time command will give the elapsed, user CPU and System CPU times.
How do I interpret it as CPU/IO time ?

Even the -s option of postgres gives those times. Will it be the same as
using "time postgres" ? Is the System time a reasonable approximation of the
I/O time and user time that of CPU time ?

Thanks
--shiby 



Fri, 06 Mar 1998 12:01:59 -0500
Shiby Thomas <sthomas@cise.ufl.edu>
Re: [HACKERS] Execution time 
Shiby Thomas wrote:
> 
> The time command will give the elapsed, user CPU and System CPU times.
> How do I interpret it as CPU/IO time ?
> 
> Even the -s option of postgres gives those times. Will it be the same as
> using "time postgres" ? Is the System time a reasonable approximation of the
> I/O time and user time that of CPU time ?


I would say they are reasonable approximations, at least for
user==CPU.
Perhaps you need to look at elapsed time too, and from that make some
assumptions about I/O waiting time. I think system time will be lower
if you use SCSI and higher with IDE.
I would count (elapsed time - CPU time) as I/O time.

/* m */

Mon, 09 Mar 1998 13:22:43 +0100
Mattias Kregert <matti@algonet.se>
Re: [HACKERS] Execution time