Selections Involving Comparisons Can implement selections of the form Asv(r)or A=r)by using a linear file scan or binary search, or by using indices in the following ways: A6(primary index,comparison).(Relation is sorted on A) For cAv(r)use index to find first tuple>v and scan relation sequentially from there For Asv(r)just scan relation sequentially till first tuple v;do not use index A7 (secondary index,comparison). For cAv(r)use index to find first index entry >v and scan index sequentially from there,to find pointers to records. For oAsv(r)just scan leaf pages of index finding pointers to records, till first entry >v In either case,retrieve records that are pointed to requires an l/O for each record Linear file scan may be cheaper Database System Concepts-5th Edition,Aug 27,2005. 13.12 ©Silberschat乜,Korth and SudarshanDatabase System Concepts - 5 13.12 ©Silberschatz, Korth and Sudarshan th Edition, Aug 27, 2005. Selections Involving Comparisons Can implement selections of the form AV (r) or A V(r) by using a linear file scan or binary search, or by using indices in the following ways: A6 (primary index, comparison). (Relation is sorted on A) For A V(r) use index to find first tuple v and scan relation sequentially from there For AV (r) just scan relation sequentially till first tuple > v; do not use index A7 (secondary index, comparison). For A V(r) use index to find first index entry v and scan index sequentially from there, to find pointers to records. For AV (r) just scan leaf pages of index finding pointers to records, till first entry > v In either case, retrieve records that are pointed to – requires an I/O for each record – Linear file scan may be cheaper