Selections Involving Comparisons Can implement selections of the form cAsv(r)or cA=r)by using a linear file scan, or by using indices in the following ways: A5(primary index,comparison).(Relation is sorted on A) For cAr)use index to find first tuple >v and scan relation sequentially from there For cAsv(r)just scan relation sequentially till first tuple>v;do not use index A6(secondary index,comparison). For cA=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 1/O for each record Linear file scan may be cheaper Database System Concepts-6th Edition 12.13 ©Silberschat乜,Korth and SudarshanDatabase System Concepts - 6 12.13 ©Silberschatz, Korth and Sudarshan th Edition Selections Involving Comparisons Can implement selections of the form AV (r) or A V (r) by using a linear file scan, or by using indices in the following ways: A5 (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 A6 (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