Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execution Plan - Timing & Tuning 1

Status
Not open for further replies.

adamroof

Programmer
Nov 5, 2003
1,107
US
Hi there.

I was reading up on date criterias and ran across an article about datediff and dateadd, all sort of arguments arose. A statement was made -
in the sample I have right now with 5000+ rows, DATEDIFF produces 65 logical reads while "BETWEEN @Date AND @Date + 1" produces only 2 logical reads

How do i test my queries to find out Logical Reads?
Whats a good starting point to learn about result tuning?

What does the information from QA Est Execution Plan help me answer?

Im still not in a high useage environment, so its not mission critical here, and thats probably the best place to start training.

I am in a Sql2K environment.
 
thanks...good to know.
Code:
Table 'Projects'. Scan count 15, logical reads 30, physical reads 0, read-ahead reads 0.
Table 'Tasks'. Scan count 18, logical reads 88, physical reads 0, read-ahead reads 0.
Table 'TasksHistory'. Scan count 2, logical reads 156, physical reads 0, read-ahead reads 0.

Do the logical reads relate directly to performance?
Does it depend on the query being run?
Less is better?

Any insight on good reads about tuning?
 
logical reads are from memory, physical reads are from disk
ideally you want to have logical reads only (which might not be feasable if your DB is larger than your RAM)

Does it depend on the query being run?
yes a query that results in a scan will have more reads than a seek

Less is better?
Sure is


Denis The SQL Menace
--------------------
SQL Server Code,Tips and Tricks, Performance Tuning
SQLBlog.com, Google Interview Questions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top