Query Processing and Optimization Flashcards

1
Q

Describe the function of the scanner, parser and validator. What happens after all these carry out their function?

A

S- Identifies language tokens
P- Check query syntax
V-Checks all attributes and relation names are valid

After all these processes are carried out an internal representation (query tree or query graph) is created

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

Define an execution strategy

A

A plan devised by the DBMS to retrieve the result of a query from database files

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

Define query optimization

A

Process of choosing a suitable execution strategy for processing a query

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

What are the main techniques of query optimization

A
  1. Heuristic rules (Logical)- for reordering operations in the query
    2.Systematically estimating the cost of different execution strategies and choosing the lowest cost estimate.(input output requirements, memory, processing power and routing protocol
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe the typical steps in processing a high-level query

A
  1. Query in high-level language
    Scanner, parser and validator
    2.Intermediate form of query eg query tree or query graph
    Query Optimizer
    3.Execution plan
    Query Code generator
    4.Object code for query
    Run-time DBMS processor
    5.Query Results
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the two internal representations of a query

A

query tree
query graph

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

How is a query tree generated from sql

A

SQL is translated into an equivalent extended relational algebra expression which is represented as a query tree

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

Describe query blocks. Illustrate how they are formed and translated

A

A query block is the basic unit that can be transformed into algebraic operators and optimized
In order to transform a given query into a query tree it is first decomposed into query blocks. The query optimizer generates an execution strategy for each query block.

A query block is made up of one SELECT-FROM-WHERE clause, and if present includes the GROUP BY and HAVING clause

*See 10 and 11 for illustrations

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