Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Execution plan analysis
Message
From
11/09/2006 09:57:01
Keith Payne
Technical Marketing Solutions
Florida, United States
 
 
To
09/09/2006 22:00:24
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01152614
Message ID:
01152746
Views:
18
>Hi,
>I am new to execution plan.
>I have 2 execution plans as below. Which is more preferable?
>
>Thank you
>
>
>  |--Nested Loops(Inner Join, OUTER REFERENCES:([Bmk1002]))
>       |--Nested Loops(Inner Join, OUTER REFERENCES:([d].[CCYCLE]))
>       |    |--Index Seek(OBJECT:([lumelids].[dbo].[DPAYRSLT].[IX_DPAYRSLT] AS [d]), SEEK:([d].[CNOEE]='1023' AND [d].[CPERIOD]='200601') ORDERED FORWARD)  && 33%
>       |    |--Index Seek(OBJECT:([lumelids].[dbo].[dpaydtl].[IX_dpaydtl] AS [p]), SEEK:([p].[CNOEE]='1023' AND [p].[CPERIOD]='200601' AND [p].[CCYCLE]=[lumelids].[dbo].[DPAYRSLT].[CCYCLE] as [d].[CCYCLE]) ORDERED FORWARD)  && 33%
>       |--RID Lookup(OBJECT:([lumelids].[dbo].[dpaydtl] AS [p]), SEEK:([Bmk1002]=[Bmk1002]) LOOKUP ORDERED FORWARD)  && 33%
>
>
  |--Hash Match(Inner Join, HASH:([Expr1005])=([Expr1006]), RESIDUAL:([Expr1005]=[Expr1006]))
>       |--Compute Scalar(DEFINE:([Expr1005]=(([lumelids].[dbo].[DPAYRSLT].[CNOEE] as [d].[CNOEE]+[lumelids].[dbo].[DPAYRSLT].[CPERIOD] as [d].[CPERIOD])+[lumelids].[dbo].[DPAYRSLT].[CCYCLE] as [d].[CCYCLE])+[lumelids].[dbo].[DPAYRSLT].[CCOMPANY] as [d].[CCOMPANY]))
>       |    |--Index Seek(OBJECT:([lumelids].[dbo].[DPAYRSLT].[IX_DPAYRSLT] AS [d]), SEEK:([d].[CNOEE]='1023' AND [d].[CPERIOD]='200601') ORDERED FORWARD)  &&4%
>       |--Compute Scalar(DEFINE:([Expr1006]=(([lumelids].[dbo].[dpaydtl].[CNOEE] as [p].[CNOEE]+[lumelids].[dbo].[dpaydtl].[CPERIOD] as [p].[CPERIOD])+[lumelids].[dbo].[dpaydtl].[CCYCLE] as [p].[CCYCLE])+[lumelids].[dbo].[dpaydtl].[CCOMPANY] as [p].[CCOMPANY]))
>            |--Table Scan(OBJECT:([lumelids].[dbo].[dpaydtl] AS [p]))  && 60%
Unfortunately, there is no simple answer to your straightforward question. The more preferable one is the one that returns the results fastest and with the least resource consumption in your server environment.

You really can't look at two execution plans and say plan A is better than plan B without knowing the data and server environment. For instance, a bookmark lookup is considered slow and something to avoid, but the alternative table scan might end up being slower if the table has many rows and the actual results are few. If the database is a high-volume OLTP system, than the amount of locking/blocking caused by plan A might have a greater impact on overall server performance than a less efficient plan B. How are the tables physically stored? Are the tables partitioned horizontally or vertically? How many real CPUs will the production server have? All of these factors plus many more determine how an execution plan will really perform. That is why a good DBA is a valuable member of the team!
Previous
Reply
Map
View

Click here to load this message in the networking platform