Query Processing & Optimisation

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/13

encourage image

There's no tags or description

Looks like no tags are added yet.

14 Terms

1
New cards

What are the aims of query processing?

  • transform high level lang query → correct & efficient execution strategy expressed in lower level lang

  • execute strategy to retrieve required data


2
New cards

What is an execution plan?

the way chosen to execute a query in relational algebra

<p>the way chosen to execute a query in relational algebra</p>
3
New cards

What type of language is relational algebra and what does that mean about the order operations are evaluated?

  • procedural language

  • operations evaluated in order specified


4
New cards

What is query optimisation?

choosing the most efficient execution plan

5
New cards

What are the 4 stages of query processing?

  1. Query Decomposition/Parsing

  2. Query Optimisation

  3. Code Generation

  4. Runtime Query Execution


6
New cards

What is used during query decomposition and what does it do?

  • DBMS QUERY PROCESSOR

    • transforms user query → sequence of operations on relations

    • selects execution strategy

      • written in low level lang

      • specifies how to retrieve + manipulate data

    • checks synthetic + semantic query correctness

    • produces relational algebra query tree


7
New cards

What are the 2 main speed performance measures?

  • Throughput

    • no. taks that can be completed within a given time period

  • Response Time

    • amount of time required to complete single task


8
New cards

What is considered during query optimisation in order to choose the most efficient execution strategy/plan for processing a query?

  • cost based strategies

    • table size

    • disk access

  • rule based strategies

    • heuristic rule: perform selection & projection as early as possible to reduce size of relation + subsequent processing of that relation

  • System catalog statistics

    • often used for cost esimation


9
New cards

At the end of the decomposition stage what is the query converted into?

  • an internal representation

    • relational algebra query tree often used


<ul><li><p>an internal representation</p><ul><li><p><strong>relational algebra query tree </strong>often used</p></li></ul></li></ul><p></p>
10
New cards

How is a query tree built?

from the leaf nodes upwards

11
New cards

What are each of the leaf nodes in a relational algebra query tree created for?

each base relation

12
New cards

What are each of the intermediate nodes in a relational algebra query tree created for?

results of relational algebra operations

13
New cards

What is the root of the tree the result of in a relational algebra query tree?

the query

14
New cards

If there are multiple joins how do you decide the join order?

  • base on the estimated size of tables & intermediate results


<ul><li><p>base on the estimated size of tables &amp; intermediate results</p></li></ul><p></p>