Skip to Main Content

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question, jessy.

Asked: January 10, 2022 - 10:15 am UTC

Last updated: January 13, 2022 - 7:51 am UTC

Version: 19.3.0.0.0

Viewed 1000+ times

You Asked

hi tom i just finished studying about TKPROF and SQLtrace. when we use TKPROF we can analyze which part of the query is having performance problem.

my question is why is cpu time is so important? what does cpu time affect? and what is the best method to reduce cpu time on queries

thanks

and Connor said...

There's a famous quote often used in Oracle circles:

"Everything is a CPU problem"

Whilst people often focus on I/O when it comes to queries, whether data comes from disks (I/O) or whether it comes from memory, the database kernel has to *process* that data (ie, sift through the blocks to find/change the rows) and that takes CPU. So improving the efficiency of a query - even if it done by focussing on reducing the I/O will ultimately reduce the CPU as well.

And in the world of servers - whether it be on-premises or cloud, you typically pay by the CPU. So CPU = money. If you can use less CPU, in effect, you are spending less money to get the same job done. (Or conversely, you can do *more* work without needing to spend more money).



Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Performance

Get all the information about database performance in the Database Performance guide.