Tuesday, March 27, 2012

Check Performance for queries

Hi,
I have two queries which will yield me the same result.
Is there a way in SQL Server(Query analyzer or Enterprise Manager) to
check the performance of both these queries and select one.
I have heard of performance plans... all those things. I am not
familiar to it. But I would like to learn.
pls guide me
Thanks
kiranAs a starter you might use the SET STATISTICS option (see BOL). Further
on you can view execution plans by selecting the option in the query
menu of Query Analyzer.
M|||Hi
You may want to look at using SQL profiler to do this see duration, reads,
writes and CPU used. You may want to see Tony's blog casts on
http://www.sqlserverfaq.com/ for an introduction to SQL Profiler. Also check
out the topic "Query Tuning", "Analyzing Queries" and "Analyzing a Query" in
books online on who to display query plans and statistics.
John
"kiran" wrote:

> Hi,
> I have two queries which will yield me the same result.
> Is there a way in SQL Server(Query analyzer or Enterprise Manager) to
> check the performance of both these queries and select one.
> I have heard of performance plans... all those things. I am not
> familiar to it. But I would like to learn.
> pls guide me
>
> Thanks
> kiran
>|||Mark he query you wnat to examine and hit CTRL-L in QA.
HTH, jens Suessmeyer.|||Jens wrote:
> Mark he query you wnat to examine and hit CTRL-L in QA.
> HTH, jens Suessmeyer.
>
Thanks a lot Guys, I will give it a try.|||Hi
Also look at running DBCC DROPCLEANBUFFERS and DBCC FREEPROCCACHE to clear
out the buffer and procedure cache.
http://www.transactsql.com/html/DBC...EANBUFFERS.html
http://www.transactsql.com/html/DBC...EPROCCACHE.html
John
"kiran" wrote:

> Jens wrote:
> Thanks a lot Guys, I will give it a try.
>

No comments:

Post a Comment