130 likes | 1.11k Views
Tree-based Indexing. Hessam Zakerzadeh. ISAM ( Indexed Sequential Access Method ). Static index structure. Effective when file is not frequently updated. Data values reside in leaf nodes. Overflow . page. Non-leaf. Pages. Leaf. Pages. Primary pages. Leaf pages contain data entries .
E N D
Tree-based Indexing HessamZakerzadeh
ISAM(Indexed Sequential Access Method) • Static index structure. • Effective when file is not frequently updated. • Data values reside in leaf nodes.
Overflow page Non-leaf Pages Leaf Pages Primary pages • Leaf pages contain data entries.
After Inserting 23*, 48*, 41*, 42* ... Root 40 Index Pages 51 63 20 33 Primary Leaf 10* 15* 20* 27* 46* 55* 40* 51* 97* 33* 37* 63* Pages 41* 48* 23* Overflow Pages 42*
Give an example of when you would use each element (A or B) for each of the following ‘A versus B’ pairs: • A hashed index using Alternative (1) versus heap file organization. • hashed index : when most of the queries are equality queries. • heap file : when a file is scanned in sequential order.
Extendible Hashing versus Linear Hashing. • Extendible Hashing : When data values lead to a skewed distribution • Linear Hashing : A large data file requiring a directory to span several pages.
Static Hashing versus Linear Hashing. • Static Hashing :When the number of values are constant and values are of form 2^n+k for various values of n and few values of k. Linear hashing becomes very skewed. • Linear Hashing: When number of records varies, and hash key values are uniformly distributed.
Static Hashing versus ISAM • Static Hashing: When the number records are constant and most of the queries are equality search • ISAM:When queries involve range queries
Linear Hashing versus B+ trees • Linear Hashing :When queries are equality search • B+ trees :When queries are range search