3. Query Processing Flashcards
Disk cost can be estimated as:
- Number of ___ * average-___
- Number of ___ * average-___
- – Number of ___ * average-___
- Seeks / seek-cost
- Blocks Read / block-read-cost
- Blocks Written / block-write-cost
In the File Scan Selection Operation we scan each ___ and test all records to see whether ___
File block
They satisfy the selection condition
The cost estimate for the File Scap operation (A1 - ___ search) = number of ___ + 1 ___
Linear search
Block transfers
Seek
In the Index Scan we use a ___ on the index ___
Condition
Search-Key
A2 (clustered index, equality on key) Retrieves ___ that satisfies the corresponding equality condition
A single record
A3 (clustered index, equality on non-key) Retrieves ___
Multiple records
A4 (non-clustered index, equality on key/non-key) Retrieves ___ if the search-key is a ___ key
OR Retrieves ___ if it is not
A single Record
Candidate
Multiple records
Selections Involving Comparisons can use both ___ Scans and ___ Scans
File
Index
A5 (clustered index, comparison)
1. For sigma A >= V (r) use __ to find ___ tuple >= v and scan relation
___ from there
2. For sigma A <= V (r) just scan relation ___ till ___ tuple > v; do not use
___
- Index / First / Sequentially
2. Sequentially / First / Index
A6 (non-clustered index, comparison)
1. For sigma A >= V (r) use __ to find ___ index entry >= v and scan relation
2. For sigma A <= V (r) 2. For sigma A <= V (r) just scan ___ pages ___ till ___ index entry > v; do not use
___
- Index / First / Sequentially
2. Leaf / Sequentially / First / Index
A7 (conjunctive selection using one index) uses a combination of ___ to ___ that results in the least ___ possible
A1
A6
Cost
A8 (conjunctive selection using composite index) uses appropriate ___ (___) index if available
Composite (multi-key)
A9 (conjunctive selection by intersection of identifiers) Requires indices with ___
Use corresponding index for each condition, and take ___ of all the obtained sets of ___
Record pointers
Intersection
Record pointers
A10 (disjunctive selection by union of identifiers) Requires ___
Use corresponding index for each condition and take ___ of all the obtained set of ___
Indexes
Union
Record pointers
The External Sort merge algorithm works by:
- ___ into ___ of N blocks
- Sort ___ and then merge them ___ at a time until obtaining ___ output
- Divide / Groups
2. Groups / Two / Sorted