CS
Database-19-QueryProcessing.pptx

S5 using a clustering index to retrieve multiple

Info icon This preview shows pages 8–12. Sign up to view the full content.

S5 Using a clustering index to retrieve multiple records : If the selection condition involves an equality comparison on a non-key attribute with a clustering index, use the clustering index to retrieve all the records satisfying the selection condition. S6 Using a secondary (B+-tree) index : On an equality comparison, this search method can be used to retrieve a single record if the indexing field has unique values (is a key) or to retrieve multiple records if the indexing field is not a key. In addition, it can be used to retrieve records on conditions involving >,>=, <, or <=. (FOR RANGE QUERIES) Query Processing and Optimization 8
Image of page 8

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Algorithms for SELECT and JOIN Operations Implementing the SELECT Operation (contd.): Search Methods for Simple Selection: S7 Conjunctive selection : If an attribute involved in any single simple condition in the conjunctive condition has an access path that permits the use of one of the methods S2 to S6, use that condition to retrieve the records and then check whether each retrieved record satisfies the remaining simple conditions in the conjunctive condition. S8 Conjunctive selection using a composite index If two or more attributes are involved in equality conditions in the conjunctive condition and a composite index (or hash structure) exists on the combined field, we can use the index directly. Query Processing and Optimization 9
Image of page 9
Algorithms for SELECT and JOIN Operations Implementing the SELECT Operation (contd.): Search Methods for Complex Selection: S9 Conjunctive selection by intersection of record pointers : This method is possible if secondary indexes are available on all (or some of) the fields involved in equality comparison conditions in the conjunctive condition and if the indexes include record pointers (rather than block pointers). Each index can be used to retrieve the record pointers that satisfy the individual condition. The intersection of these sets of record pointers gives the record pointers that satisfy the conjunctive condition, which are then used to retrieve those records directly. If only some of the conditions have secondary indexes, each retrieved record is further tested to determine whether it satisfies the remaining conditions. Query Processing and Optimization 10
Image of page 10

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Algorithms for SELECT and JOIN Operations Implementing the SELECT Operation (contd.): Whenever a single condition specifies the selection, we can only check whether an access path exists on the attribute involved in that condition. If an access path exists, the method corresponding to that access path is used; otherwise, the “brute force” linear search approach of method S1 is used. (See OP1, OP2 and OP3) For conjunctive selection conditions , whenever more than one of the attributes involved in the conditions have an access path, query optimization should be done to choose the access path that retrieves the fewest records in the most efficient way.
Image of page 11
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '09
  • SUNANHAN
  • Query optimizer, JOIN Operations

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern