[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

query tuning

Asked by anushahanna in MS SQL Server, SQL Server 2005, SQL Query Syntax

Could you comment if this query could be further optimized? I have attached the Execution Plan at the end

---------------------------------

SELECT  count(*)
FROM (select AA.Col1,G.Code,E.Col2,C.Col3 from AA, BB, CC where AA.AAKEY1 = BB.BBKEY1 and BB.KEY2 = CC.KEY2) A
        INNER JOIN B  ON
            A.Key1 = B.Key1 --4654
----------------------------
        INNER JOIN C  ON
            B.Key2 = C.Key2 --1798230
----------------------------
      INNER JOIN D ON
            C.Key3 = D.Key3 --1798230
----------------------------
      INNER JOIN E ON
            D.Key6 = E.Key6 --1798230
----------------------------
      INNER JOIN F ON
            D.Key6 = F.Key6 --1798230
----------------------------
      INNER JOIN G ON
            D.Key7 = G.Key7  --1885478
----------------------------
      INNER JOIN H ON
            G.Key8 = H.Key8 --1885478
----------------------------
WHERE           
      (H.Code = 'ABC')  --128584
----------------------------
      
Table 'C'. Scan count 1, logical reads 16064, physical reads 0, read-ahead reads 16093.
Table 'D'. Scan count 1, logical reads 964, physical reads 0, read-ahead reads 0.
Table 'G'. Scan count 1, logical reads 387, physical reads 0, read-ahead reads 0.
Table 'H'. Scan count 1, logical reads 10, physical reads 0, read-ahead reads 0.
Table 'F'. Scan count 1, logical reads 1, physical reads 0, read-ahead reads 0.
Table 'E'. Scan count 1, logical reads 7, physical reads 0, read-ahead reads 0.
Table 'B'. Scan count 1, logical reads 1481, physical reads 0, read-ahead reads 0.
Table 'AA'. Scan count 1, logical reads 35, physical reads 0, read-ahead reads 0.
Table 'BB'. Scan count 1, logical reads 216, physical reads 0, read-ahead reads 0.
Table 'CC'. Scan count 1, logical reads 1, physical reads 1, read-ahead reads 0.
[+][-]11/04/09 06:20 AM, ID: 25739482Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 06:21 AM, ID: 25739493Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 06:49 AM, ID: 25739814Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 06:52 AM, ID: 25739841Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 07:24 AM, ID: 25740227Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/04/09 07:24 AM, ID: 25740229Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/04/09 07:31 AM, ID: 25740294Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 07:49 AM, ID: 25740514Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/04/09 07:54 AM, ID: 25740566Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 07:56 AM, ID: 25740593Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 07:56 AM, ID: 25740595Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/04/09 08:00 AM, ID: 25740641Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 12:04 PM, ID: 25743332Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625