5: Query Processing/ Optimisation Flashcards

1
Q

What is query processing?

A

It’s the steps required to execute a query.

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

What costs does processing incur?

A
  • I/O costs for accessing the data
  • Communications costs for transmitting data over any distance
  • CPU costs for processing the data

Summary: accessing, transmitting and processing costs

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

What is query optimisation?

A

It’s one of the steps in query processing which is used to identify the ‘best’ execution strategy ie the one with the minimum resources and therefore costs required to execute the query.

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

What are the 3 different levels in a tree structure?

A
  • Leaf node level -> relations
  • Non-leaf node level -> RA operations
  • Root-node level -> result
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the heuristic approach?

A

Its then transformation rules convert algebraic expressions into alternative forms (several trees).

Each tree has its own unique execution sequence, with unique costs for that sequence.

Heuristic approach provides alternative forms that are more efficient, eg perform a select before performing a join.

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

The initial tree is based on the Cartesian Product of the relations. Would you use this tree?

A

No.

The Cartesian Product produces all possible combinations of any join – resulting in very large relations.

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

The query optimiser produces several execution sequences. Does it then look for the ‘absolute best’ one?

A

No, this would add to the cost.

Optimisation is about selecting from the alternatives an execution sequence that is considered efficient enough to run the query, even though there may be other more efficient ones available.

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

How do you read the relational algebra tree?

A

Bottom-up ^

Start at leaf-nodes and traverse up the root.

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