05[1] - CS 186 Discussion Section Week 5 Peter Alvaro and...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

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

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

Unformatted text preview: CS 186 Discussion Section Week 5 Peter Alvaro and Kuang Chen February 23, 2009 File Organization Data entry alternatives The three alternatives for data entries with search key k are: 1. data entry k * is an actual data record matching the key 2. data entry is a < k,rid > pair where rid is the record id of a data record matching the key 3. data entry is a < k,rid- list > pair, where rid- list is a list of record ideas matching the key For which of the 3 data entry alternatives can we have a clustered index? A clustered index is one that is organized so that ordering of the data records within the corresponding file are the same as or close to the ordering of data entries in the index. Alternative 1 by definition is clustered. An index that uses Alternative 2 or 3 can be a clustered only if the data records are sorted on the search key field. Usually though, this is not the case. Discussion question: You are about to create an index on a relation. Discuss some considera- tions that guide your choices of the following. (a) The choice of primary index (b) Clustered vs unclustered indexes (c) The use of a sorted file vs a tree based index (d) Choice of search key for the index. (a) The choice of the primary key is made based on the semantics of the data. If we need to retrieve records based on the value of the primary key, as is likely, we should build an index using this as the search key. If we need to retrieve records based on the values of fields that do not constitute the primary key, wekey....
View Full Document

Page1 / 3

05[1] - CS 186 Discussion Section Week 5 Peter Alvaro and...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online