简体   繁体   中英

How are logical reads calculated?

I've read the definition of logical reads from:

http://msdn.microsoft.com/en-us/library/ms184361.aspx

it says:

"Number of pages read from the data cache."

I have two tables (Row count of table_1 is 141 , and table_2 is 16.811 ), when I run those two queries, it gives the following result.

SELECT * FROM Table_1

results
Scan count 1, logical reads 6, physical reads 0, read-ahead reads 0.

SELECT * FROM Table_2

results
scan count 1, logical reads 701, physical reads 0, read-ahead reads 0

if logic reads is "Number of pages read from the data cache." then what is a page ? How it is calculated ?

A page is a minimal physical data unit SQL Server works with.

A page is 8K long and may contain several table records, index records and other information.

Even if a row is 10 bytes long, the whole page needs to be read.

In your case, a page contains about 20 rows in average.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM