QueryOptimization Flashcards

1
Q

What is query optimization?

A

The process of selecting the most efficient query-evaluation plan from possible strategies for processing a query

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

What are the two main aspects of optimization?

A

1) Finding equivalent but more efficient relational-algebra expressions 2) Selecting detailed processing strategies (algorithms, indices)

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

What are the three steps to generate query-evaluation plans?

A

1) Generate logically equivalent expressions 2) Annotate expressions to create alternative plans 3) Estimate costs and choose least costly plan

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

What three factors is plan cost estimation based on?

A

1) Statistics about relations 2) Statistics estimation for intermediate results 3) Cost formulas for algorithms

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

What makes two relational-algebra expressions equivalent?

A

They generate the same set of tuples on every legal database instance

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

How can join operations be optimized?

A

By carefully choosing the join order to reduce size of temporary results

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

What is a cost-based optimizer?

A

A system that explores all equivalent query-evaluation plans and chooses the one with least estimated cost

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

What are two common types of histograms used in databases?

A

Equi-width histograms and equi-depth histograms

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

When are database statistics typically updated?

A

During periods of light system load

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

What is a key heuristic rule for query optimization?

A

Perform selections as early as possible to reduce number of tuples

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