472,950 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,950 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 5487
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...

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.