Eg age 20 or age20 and sal 10 data entries in index

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: gributes in WHERE clause are candidates for index keys. –  Exact match condi6on suggests hash index. –  Range query suggests tree index. •  Clustering is especially useful for range queries; can also help on equality queries if there are many duplicates. •  Mul6 ­agribute search keys should be considered when a WHERE clause contains several condi6ons. –  –  Order of agributes is important for range queries. Such indexes can some6mes enable index ­only strategies for important queries. •  For index ­only strategies, clustering is not important! •  Try to choose indexes that benefit as many queries as possible. Since only one index can be clustered per rela6on, choose it based on important queries that would benefit the most from clustering. Examples of Clustered Indexes •  B+ tree index on E.age can be used to get qualifying tuples. –  –  How selec6ve is the condi6on? Is the index clustered? SELECT E.dno FROM Emp E WHERE E.age>40 •  Consider the GROUP BY query. –  –  SELECT E.dno, COUNT (*) If many tuples have E.age >...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online