473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Logical Reads = CPU Consumption ???

Until today I always thought as long as you see a lot of logical reads
as compared to physical reads, then you're good. But it looks like it
isn't so. But doesn't logical read mean it's being read from memory
and no I/O involved? So why is Logical Reads = CPU Consumption ?

I ran into an exact scenario last week when our applciation were
running something, and each time an application started, the CPU would
go from 99% idle to 48% idle. I took the snapshot for each application
and all i saw was logical reads. Here are some outputs from the
snapshot:

App 1
Buffer pool data logical reads = 5463749
Buffer pool data physical reads = 0
Buffer pool index logical reads = 1022588
Buffer pool index physical reads = 0

App2
Buffer pool data logical reads = 25831618
Buffer pool data physical reads = 0
Buffer pool index logical reads = 4836091
Buffer pool index physical reads= 0

Similarly, there are more applications with similar output. As you can
see, there are no physical reads and a lot of logical reads. And as I
said, each time an application was running, the CPU went up to 48%
idle. Does this suggest the logical reads taking all the CPU?

All applications were seen to be running the routine :
CALL SYSIBM.SQLCOLUMNS(?,?,?,?,?)

Have anyone heard of this routine? What does it do?

Oct 15 '07 #1
2 5513
dbtwo wrote:
Until today I always thought as long as you see a lot of logical reads
as compared to physical reads, then you're good. But it looks like it
isn't so. But doesn't logical read mean it's being read from memory
and no I/O involved? So why is Logical Reads = CPU Consumption ?

I ran into an exact scenario last week when our applciation were
running something, and each time an application started, the CPU would
go from 99% idle to 48% idle. I took the snapshot for each application
and all i saw was logical reads. Here are some outputs from the
snapshot:

App 1
Buffer pool data logical reads = 5463749
Buffer pool data physical reads = 0
Buffer pool index logical reads = 1022588
Buffer pool index physical reads = 0

App2
Buffer pool data logical reads = 25831618
Buffer pool data physical reads = 0
Buffer pool index logical reads = 4836091
Buffer pool index physical reads= 0

Similarly, there are more applications with similar output. As you can
see, there are no physical reads and a lot of logical reads. And as I
said, each time an application was running, the CPU went up to 48%
idle. Does this suggest the logical reads taking all the CPU?

All applications were seen to be running the routine :
CALL SYSIBM.SQLCOLUMNS(?,?,?,?,?)

Have anyone heard of this routine? What does it do?
I think this routine is called by CLI. That's all I know.

In general, of course logical reads imply CPU usage.
If you read a page from memory there is no I/O wait. And if there is no
I/O wait there is no idle time between the request and the delivery of
your data.....

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Oct 15 '07 #2
Ian
dbtwo wrote:
Until today I always thought as long as you see a lot of logical reads
as compared to physical reads, then you're good. But it looks like it
isn't so. But doesn't logical read mean it's being read from memory
and no I/O involved? So why is Logical Reads = CPU Consumption ?
The issue is when you have a large number of logical reads (in relation
to the number of rows selected). The CPU still has to perform the
comparisons in memory.

Imagine a 4 Gb table, stored completely in the bufferpool, but with no
indexes. Every single query against this table has to look at 4 Gb
worth of bufferpool pages (even if the query returns only a single row).

So while you won't see any I/O, one CPU will be 100% consumed by the
db2 agent servicing the query.

Oct 20 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Wim Deprez | last post by:
Hi Group, for a project I am trying to find an OS independant way to measure the amount of cpu usage and memory consumption of the program. It would be nice if I could do that in my C++ code, so...
8
by: patrickshroads | last post by:
I am running a profiler trace against a database and noticed that the reads column always shows 0. When running the same trace against another machine I get back values in the reads column. I took...
10
by: Marty | last post by:
Hi, Does anybody is experiencing a lot of RAM consumption when using many threads ? If yes, how can we reduce that level of used memory? Thanks tou! Marty
3
by: serge | last post by:
How do I determine which method I should use if I want to optimize the performance of a database. I took Northwind's database to run my example. My query is I want to retrieve the Employees'...
4
by: serge | last post by:
I am running a query in SQL 2000 SP4, Windows 2000 Server that is not being shared with any other users or any sql connections users. The db involves a lot of tables, JOINs, LEFT JOINs, UNIONS...
7
by: Roman Petrichev | last post by:
Hi folks. I've just faced with very nasty memory consumption problem. I have a multythreaded app with 150 threads which use the only and the same function - through urllib2 it just gets the web...
1
by: liubin | last post by:
I have created a simple program using C#/.NET. It is very small program without explicit system resources request in the code. However, the memory consumption is even above 17M(shown in Windows...
2
by: dattaforit | last post by:
Hello All, I have a Window service developed using Visual Studio .Net 2003. I am using VC++ .Net for the service development. The physical and virtual memory consumption is very high. How should...
2
by: Jonas Maurus | last post by:
Hello everybody, I'm pondering the following problem: I want to write a Python program that receives messages via SMTP and stores them in a dict or an array. For my purposes it would be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.