Re: Using Function Table ? using Sql Server 2008
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Sat, 27 Jun 2009 14:58:39 -0700
Luqman (pearlsoft@xxxxxxxxxxxx) writes:
As I have no sound knowledge about performance and tuning of queries,
however I have heard that performance can be evaluated using Execution
Plan, is it true? if so, how ?
Hm, to evalutate performance as such, run the query with production-size
data like this:
SELECT @d = getdate()
<query>
SELECT datediff(ms, @d, getdate())
If the time returned is satisfactory, you don't really have to do more.
It is when the execution time is not to your like when it's time to
look at the query plan, to get an idea of what the problem might be.
I should hasten to add that I am simplifying things a bit here. Even
if the execution time seems to be OK, it may still be worth to look at
the query plan. This may reveal a scan that could be avoided and that
it's possible to get the query running even faster.
Another very important thing here is caching. If you run the same
query twice, you may find that it executes much faster the second
time. This is because the first time, the data was on disk, whereas
teh second time it was in cache. This is particularly important if
you want to compare two queries for the same problem.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- Using Function Table ? using Sql Server 2008
- From: Luqman
- Re: Using Function Table ? using Sql Server 2008
- From: Dan Guzman
- Re: Using Function Table ? using Sql Server 2008
- From: Luqman
- Using Function Table ? using Sql Server 2008
- Prev by Date: Re: Using Function Table ? using Sql Server 2008
- Next by Date: Re: Query Cursor from Another Cursor
- Previous by thread: Re: Using Function Table ? using Sql Server 2008
- Next by thread: Re: Using Function Table ? using Sql Server 2008
- Index(es):
Relevant Pages
|
Loading