Question
Selection algorithms. For each of the selection algorithms in the textbook (A1 to A10) (Database System Concepts), provide a sample scenario using table(s) in Banking
Selection algorithms. For each of the selection algorithms in the textbook (A1 to A10) (Database System Concepts), provide a sample scenario using table(s) in Banking database. For each scenario, describe which table(s) is/are used, how the file(s) is/are organized (along with index information, if applicable) and a specific query for which the algorithm is applicable. (At least one table should be used in each example.)
For your convenience, again here is the Banking database schema:branch (branch-name, branch-city, assets)customer (customer-name, customer-street, customer-city)account (account-number, branch-name, balance)loan (loan-number, branch-name, amount)depositor (customer-name, account-number)borrower (customer-name, loan-number)
Algorithm Cost ts +b * Reason ear Searc One initial seek plus b, trans where b, denotes the number of blocks in the file at most one record satisties con- Equality on case ts dition, scan can be terminated as soon as the required record is found. In the worst case, b, blocks transfers are still ar erage Key (b,/2) uired ere imry es in- B+-tree Index, (trts) dex.) Index lookup traverses the height of the tree plus one I/O to fetch the record; each of these I/O operations re- Equality or uires a seek and a block transfer A3 Primary (tT One seek for each level of the tree, one B+-tree Index, ts) +b t seek for the first block. Here b is the number of blocks containing records with the specified search key, all of which are read. These blocks are leaf blocks assumed to be stored sequen- tially (since it is a primary index) and Equality on Nonkey uire additional seeks don't *This case is similar to primary index. A4 Secondary (hi + I) B+-tree Index, (t ts) Equality or Ke ary n 1s nu er of recor B+-tree Index, (tr+ts)fetched.) Here, cost of index traversal Equality on Nonkey is the same as for A3, but each record may be on a different block, requiring a seek per record. Cost is potentially very high if n is large Primary +Identical to the case o equality or B+-tree Index, | ts) + b * nonkey Comprison ary tidentical to the case equality on B+-tree Index, (t+ts) nonkey. Comprison Algorithm Cost ts +b * Reason ear Searc One initial seek plus b, trans where b, denotes the number of blocks in the file at most one record satisties con- Equality on case ts dition, scan can be terminated as soon as the required record is found. In the worst case, b, blocks transfers are still ar erage Key (b,/2) uired ere imry es in- B+-tree Index, (trts) dex.) Index lookup traverses the height of the tree plus one I/O to fetch the record; each of these I/O operations re- Equality or uires a seek and a block transfer A3 Primary (tT One seek for each level of the tree, one B+-tree Index, ts) +b t seek for the first block. Here b is the number of blocks containing records with the specified search key, all of which are read. These blocks are leaf blocks assumed to be stored sequen- tially (since it is a primary index) and Equality on Nonkey uire additional seeks don't *This case is similar to primary index. A4 Secondary (hi + I) B+-tree Index, (t ts) Equality or Ke ary n 1s nu er of recor B+-tree Index, (tr+ts)fetched.) Here, cost of index traversal Equality on Nonkey is the same as for A3, but each record may be on a different block, requiring a seek per record. Cost is potentially very high if n is large Primary +Identical to the case o equality or B+-tree Index, | ts) + b * nonkey Comprison ary tidentical to the case equality on B+-tree Index, (t+ts) nonkey. Comprison
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started