• Keine Ergebnisse gefunden

Relational Databases 2 Exercise Sheet 8: Query Optimization 3

N/A
N/A
Protected

Academic year: 2021

Aktie "Relational Databases 2 Exercise Sheet 8: Query Optimization 3"

Copied!
1
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Relational Databases 2

Exercise Sheet 8: Query Optimization 3

Exercise 1- Join Trees and Join Cost Estimation

Assume we are given the SQL query from last week’s exercise sheet 7 and the information from the table below.

SELECT a.aliasName, pt.label

FROM persons p, aliases a, superPowers sp, powerType pt, powerOrigin po

WHERE pt.id=sp.powerType_id AND p.id=sp.persons_id AND po.id=p.powerOrigin_id AND p.id=a.persons_id AND po.label=’Mutation’ AND sp.powerStrength=>7

AND NOT a.aliasName=’Magneto’

a. How many different Join trees can be built for this query? How many different Deep Left Join trees exist?

b. Perform an intermediate result estimation for the different JOINS required to answer the query and explain them.

c. In which cases, data statistics can help to improve intermediate result estimations? Give 2 examples how histograms could be used to improve the estimations.

d. Find a left join tree based on your intermediate result estimations as costs using the greedy procedure presented in the lecture. What are the overall costs?

Table Column Unique Values

Persons id 45823

powerOrigin 198

firstName 10034

lastName 23923

Aliases Id 55021

Persons_id 45711

aliasName 55009

superPowers id 74124

powerType_id 13

Persons_id 44998

powerStrength 35

powerType Id 23

Label 23

Description 23

PowerOrigin Id 199

Label 189

Description 189

Abbildung

Table  Column  Unique Values

Referenzen

ÄHNLICHE DOKUMENTE

Apply and visualize the timestamp ordering algorithm for both schedules.. Can the schedule

c) Describe briefly the 3 phases of ARIES. d) What does steal/no-steal and force/no-force mean with regard to buffer management for

Considering a large company: Would they prefer role-based access control or discretionary access control.. Please explain

Provide an example on how perturbation-based techniques can improve statistical database

Why are simple binary search trees unsuitable for indexing database records.. Exercise 2

What are the main steps that need to be processed in order to answer a user’s query.. What needs to be optimized in

Exercises will be discussed on Friday on week after the respective lecture was given. The handouts are optional and do not have to be handed in. They only serve as optional

e) For each power type of powers with greater reach than 5, return the number of heroes that possess it.