Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
Physical Tuning
Lecture 12
March 23, 2016 Physical Tuning 1
Physical Tuning Lecture 12 Physical Tuning March 23, 2016 1 - - PowerPoint PPT Presentation
Wentworth Institute of Technology COMP2670 Databases | Spring 2016 | Derbinsky Physical Tuning Lecture 12 Physical Tuning March 23, 2016 1 Wentworth Institute of Technology COMP2670 Databases | Spring 2016 | Derbinsky Outline
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 1
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 2
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 3
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
– Queried = potentially good for indexes – Updated = bad for indexes – Unique = could be indexed
– 80/20 rule – Updates
– e.g. must complete within X seconds
– Storage allocation – I/O performance – Query execution time
March 23, 2016 Physical Tuning 4
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 5
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 6
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 7
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 8
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 9
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 10
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 11
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 12
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 13
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
– Salary/2000 > 10.50
– Aqty = Bqty, where Aqty is INTEGER and Bqty is SMALLINTEGER
– ReportsTo IS NULL
– Lname LIKE '%mann'
March 23, 2016 Physical Tuning 14
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 15
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 16
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 17
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 18
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 19
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
A query with multiple selection conditions that are connected via OR may not be prompting the query optimizer to use any index. Such a query may be split up and expressed as a union of queries, each with a condition on an attribute that causes an index to be used. For example, SELECT Fname, Lname, Salary, Age FROM EMPLOYEE WHERE Age > 45 OR Salary < 50000; may be executed using table scan giving poor performance. Splitting it up as SELECT Fname, Lname, Salary, Age FROM EMPLOYEE WHERE Age > 45 UNION SELECT Fname, Lname, Salary, Age FROM EMPLOYEE WHERE Salary < 50000; may utilize indexes on Age as well as on Salary
March 23, 2016 Physical Tuning 20
Wentworth Institute of Technology COMP2670 – Databases | Spring 2016 | Derbinsky
March 23, 2016 Physical Tuning 21