Benchmark code

Benchmark code

Post by Jenda Krynic » Sun, 31 Dec 1899 09:00:00



I'm ashamed of myself, I'm sure it is written somewhere and I missed it completely ...

How do I time a statement? I mean If I want to try out the performance of two different
ways to do something how should I measure them?

If I use the wallclock time I do not get anything realy useable since it depends not only
on those statements, but also the server load at the time. I might run both versions several
times intermixed and average them but it doesn't seem right anyway.

And if you want to compare the difference made by an index or whatever it's next to unusable.

So is there any way to get the time the server spent on some statement ?

Thanks, Jenda
http://Jenda.Krynicky.cz

P.S.: A CC: will be appreciated.

 
 
 

Benchmark code

Post by Jerry Gitome » Sun, 31 Dec 1899 09:00:00



> I'm ashamed of myself, I'm sure it is written somewhere and I missed it completely ...

> How do I time a statement? I mean If I want to try out the performance of two different
> ways to do something how should I measure them?

> If I use the wallclock time I do not get anything realy useable since it depends not only
> on those statements, but also the server load at the time. I might run both versions several
> times intermixed and average them but it doesn't seem right anyway.

> And if you want to compare the difference made by an index or whatever it's next to unusable.

> So is there any way to get the time the server spent on some statement ?

> Thanks, Jenda
> http://Jenda.Krynicky.cz

> P.S.: A CC: will be appreciated.

        Try     SET TIMING ON  It works quite well for individual statements.

--
Jerry Gitomer
Once I learned how to spell DBA, I became one.