Homework:

 

1. Why is searching for large-table full-table scanscritical to SQL tuning?

 

a) They indicate an optimized execution plan.

b) They may be able to be tuned to use an index

c) The full-table scan should be normalized from thedatabase design

d) A full-table scan is always sub-optimal.

 

2. What best describes the relationship between indexes andSQL performance?

 

a) Indexes are only used in special cases

b) Indexes are used to make table storage more efficient

c) Indexes rarely make a difference in SQL performance

d) Indexes exist solely to improve query speed.

 

3. List table joins type.

 

4. The performance is always good if using Index. Is itright? Why?

 

5. Assume EMP has 100,000 records while DEPT has 100records. No index in both tables currently.

               SALES department has 280 employees.

   Please tuning the query to get the bestperformance you think and explain why.

  

   SELECT E.EMPNO, E.ENAME, E.JOB FROM EMPE,DEPT D WHERE E.DEPTNO = D.DEPTNO AND D.DNAME = 'SALES';

 

 

 

PPT:

Filename: "SQL tuning_Intern_2015.sql" (16.01 KB)

Location: http://filelink.nam.nsroot.net/FileLink/GetFile.aspx?id=45F42257-106F-451D-89AA-21FB096C9589

(Note: This file will not be available for download after 12Feb 2015)

 

Filename: "SQL tuning.pptx" (1.77 MB)

Location: http://filelink.nam.nsroot.net/FileLink/GetFile.aspx?id=2BE07F18-DE9B-4C67-8DD2-D26306B58F2B

(Note: This file will not be available for download after 12Feb 2015)

 

 

Best regards,

Ellen Zhang

ICG China Development Center

Citigroup Software Technology andServices (China) Ltd

Tel:  +86 21 28960325

Fax: +86 21 50804275