3. Query Processing Flashcards

1
Q

Disk cost can be estimated as:

  1. Number of ___ * average-___
  2. Number of ___ * average-___
  3. – Number of ___ * average-___
A
  1. Seeks / seek-cost
  2. Blocks Read / block-read-cost
  3. Blocks Written / block-write-cost
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In the File Scan Selection Operation we scan each ___ and test all records to see whether ___

A

File block

They satisfy the selection condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The cost estimate for the File Scap operation (A1 - ___ search) = number of ___ + 1 ___

A

Linear search
Block transfers
Seek

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In the Index Scan we use a ___ on the index ___

A

Condition

Search-Key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A2 (clustered index, equality on key) Retrieves ___ that satisfies the corresponding equality condition

A

A single record

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A3 (clustered index, equality on non-key) Retrieves ___

A

Multiple records

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A4 (non-clustered index, equality on key/non-key) Retrieves ___ if the search-key is a ___ key
OR Retrieves ___ if it is not

A

A single Record
Candidate
Multiple records

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Selections Involving Comparisons can use both ___ Scans and ___ Scans

A

File

Index

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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
___

A
  1. Index / First / Sequentially

2. Sequentially / First / Index

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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
___

A
  1. Index / First / Sequentially

2. Leaf / Sequentially / First / Index

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A7 (conjunctive selection using one index) uses a combination of ___ to ___ that results in the least ___ possible

A

A1
A6
Cost

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A8 (conjunctive selection using composite index) uses appropriate ___ (___) index if available

A

Composite (multi-key)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A9 (conjunctive selection by intersection of identifiers) Requires indices with ___
Use corresponding index for each condition, and take ___ of all the obtained sets of ___

A

Record pointers
Intersection
Record pointers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A10 (disjunctive selection by union of identifiers) Requires ___
Use corresponding index for each condition and take ___ of all the obtained set of ___

A

Indexes
Union
Record pointers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The External Sort merge algorithm works by:

  1. ___ into ___ of N blocks
  2. Sort ___ and then merge them ___ at a time until obtaining ___ output
A
  1. Divide / Groups

2. Groups / Two / Sorted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Nested-Loop Join cost is ___ since it examines every ___ in the two
___

A

Expensive
Pair of tuples
Relations

17
Q

Block Nested-Loop Join reads each ___ in the ___ relation s once for each ___ in the ___ relation

A

Block
Inner
Block
Outer

18
Q

Indexed Nested-Loop Join

For each __ tr in the outer relation r, use the ___ to look up ___ in s that satisfy the ___ with tuple tr

A

Tuple
Index
Tuples
Join

19
Q

Merge-Join

Each ___ needs to be read only once (assuming all ___ for any given ___ of the join attributes fit in memory)

A

Block
Tuples
Value

20
Q

Hash-Join

Read and write every ___ and compare the ___ in the ___ by reading them once more

A

Block
Tuples
Partitions

21
Q

Materialized evaluation: evaluate one ___ at a time, starting at the ___-___. Use intermediate results
materialized into ___ to evaluate next-level
operations.

A

Operation
Lowest-level
Temporary Relations

22
Q

Pipelined evaluation: evaluate several operations

___, passing the results of ___ to the ___.

A

Simultaneously
One operation
Next

23
Q

Pipelined is much ___ than materialization as there is ___ to store a ___ to disk. But sometimes it may not be possible to use it, Ex: ___ and ___

A

Cheaper
No need
temporary relation
Sort and Hash-Join