• Keine Ergebnisse gefunden

Query Tuning Database Tuning

N/A
N/A
Protected

Academic year: 2022

Aktie "Query Tuning Database Tuning"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Assignment 2

Query Tuning

Database Tuning

Start date: October 20, 2015

Due date: November 02, 12:00 (Mittag) Grading: 1 point

In this assignment you will gain hands-on experience in rewriting slow queries and in experimentally evaluating the rewritten queries.

Task 1: Create a database with the following database schema:

• Employee(ssnum,name,manager,dept,salary,numfriends) – unique index onssnum

– unique index onname – index on dept

• Student(ssnum,name,course,grade) – unique indexes on ssnum

– unique indexes on name

• Techdept(dept,manager,location) – unique index ondept

– a manager may manage multiple departments – a location may contain multiple departments

Task 2: Fill the database with 100k employees, 100k students, and 10 technical departments. Only about 10% of the employees are in a technical department.

The types of the attributes should make sense (e.g., ssnum should be an integer), but the values need not be meaningful (e.g., names can be random strings).

Task 3: Choose two types of queries that might be hard for your database to optimize. Taking queries from the lecture notes is OK.

NOTE: For at least one of your queries rewriting should make a difference.

Task 4: Rewrite the queries and consult the execution plans of the original and the rewritten query.

Task 5: Run the original and the rewritten query and measure the runtime.

Report:

• Describe your instance (data types, how did you fill the tables?).

• Give the original and the rewritten queries.

(2)

• Show and explain the execution plans.

• Report and briefly discuss the runtime results from your experiment.

Please indicate the average time per group member that was spent solving this assignment. The time that you indicate will haveno impact on your grade.

Referenzen

ÄHNLICHE DOKUMENTE

Rewritten Queries and Execution Plans Rewrite the queries and consult the execution plans of the original and the rewritten query!. The rewritten query must lead to the same

WHERE salary > (SELECT AVG(salary) FROM Employee) without aggregates in the inner query. SELECT ssnum

1 Query Tuning Query Processing Problematic Queries Minimizing DISTINCTs Rewriting of Nested Queries.. Augsten (Univ. Salzburg) DBT – Query Tuning Sommersemester 2019 2

Implement the straightforward approach to load auth.tsv to the database (PostgreSQL, Java/Python)..

Original query 1: description of query plan 0.5 Rewritten query 1: description of query plan 0.5 Difference between original and rewritten query 1 0.5 Original query 2: description

1 Query Tuning Query Processing Problematic Queries Minimizing DISTINCTs Rewriting of Nested Queries.. Nikolaus Augsten (DIS) DBT – Query Tuning Unit 2 – WS 2016/17 2

Task 1: Implement the straightforward approach to load auth.tsv to the database (PostgreSQL, Java).. Task 2: The straightforward approach

WHERE salary = (SELECT AVG(e2.salary) FROM Employee e2, Techdept WHERE e2.dept = e1.dept AND e2.dept = Techdept.dept) without aggregates in the inner query (uncommon). Nikolaus