• Keine Ergebnisse gefunden

DatabaseTuning IndexTuning–Selection Assignment4

N/A
N/A
Protected

Academic year: 2022

Aktie "DatabaseTuning IndexTuning–Selection Assignment4"

Copied!
3
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Assignment 4

Index Tuning – Selection

Database Tuning

Due date: May 15, 2019, 23:55 Grading: 5 points

Notes

• It is suggested that you also have a look at the report template before you start working on the assignment.

Access Parameters for PostgreSQL

• Host: biber.cosy.sbg.ac.at

• Port: 5432

• Database: dbtuning_ss2019

• User/Password: you should have received them via email

The database server (biber.cosy.sbg.ac.at) is accessible only from within the univer- sity network. If you would like to work from home, please connect tofanny.cosy.sbg.ac.at via ssh. Java, the PostgreSQL client, and Python are installed on this machine.

Support

If there are any ambiguities or problems of understanding regarding the assignment, you have the following possibilities to clarify them:

• Slack channel#dbt20191 (preferred way of communication)

• Upon request via email (dkocher@cs.sbg.ac.at)

In this assignment you will experiment with indexes using PostgreSQL 9.6.

Downloadhttps://dbresearch.uni-salzburg.at/downloads/teaching/2018ss/dbt/dblp.zipThis archive contains two tab-separated files (publ.tsv and auth.tsv) that store authors and their publications as found in the DBLP2bibliography. The imported tables have the following schemas:

• Auth(name(49),pubID(129))

• Publ(pubID(129),type(13),title(700),booktitle(132), year(4),publisher(196))

You can assume that all attribute values are strings; the maximum string length is shown in brackets. Publ.pubIDis a key.

1https://dbteaching.slack.com

2http://dblp.uni-trier.de/db/

1

(2)

Comparison of Index Types

Compare

1. clustering B+ tree, 2. non-clustering B+ tree,

3. non-clustering hash index, and 4. table scan (no index)

for the following queries and measure the throughput.

Repeat the queries multiple times with different conditions for pubID, booktitle, and year, respectively.

/* P o i n t Q u e r y */

S E L E C T * F R O M P u b l W H E R E p u b I D = ...

/* M u l t i p o i n t Q u e r y - Low S e l e c t i v i t y */

S E L E C T * F R O M P u b l W H E R E b o o k t i t l e = ...

/* M u l t i p o i n t Q u e r y - H i g h S e l e c t i v i t y */

S E L E C T * F R O M P u b l W H E R E y e a r = ...

Report

1. Explain your experimental setup, i.e., how did you send the queries to the database and how did you measure throughput?

2. Which conditions did you use for each of the query types (pubID, booktitle, year)? Use the same conditions for all index settings on a particular query type.

3. Give the throughput results and the query plan for each query type and each index setting.

4. Discuss your observations. Are the results expected? Why (not)?

Notes about the Experimental Setup

• To compute the throughput, measure the overall runtime for several runs of a query and divide the number of queries by the runtime. The overall runtime should be more than one minute to decrease the measurement error.

• When you repeat a query to measure the throughput, do not use the same condition in the WHERE clauses of the repeated queries. Instead, use different conditions for each call, for example,year = 1980,year = 2001,year = 2004, and so on.

• Do not specify a primary key, a foreign key, or uniqueness constraints when you create the tables. PostgreSQL automatically creates an index to ensure uniqueness, which you want to avoid for some of the queries.

• To test the non-clustering indexes, cluster the table according to an attribute that is independent of the indexed attribute, e.g., cluster the table according totitle for the condition on year.

2

(3)

Notes about PostgreSQL

• Clustering indexes: You first create an index, then you use the index to cluster the table (i.e., physically sort the table by the index attribute).

Example:

C R E A T E I N D E X y e a r _ i d x ON p u b l (y e a r);

C L U S T E R p u b l U S I N G y e a r _ i d x ;

• Query plan: The command EXPLAIN shows the query plan without executing the query. The command EXPLAIN ANALYZEalso executes the query.

Example:

E X P L A I N A N A L Y Z E S E L E C T * F R O M p u b l W H E R E y e a r=’ 2 0 0 6 ’;

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

Grading scheme:

Category Max. Points

Description of your setup (1.) 1

Selection of conditions (2.) 0.5

Throughput results and query plan (3.) 1

Interpretation of query plans 1

Interpretation of the results 1.5

Reminder:Additional questions about the involved topics/techniques will be asked during the meeting.

Important:If the grading scheme is unclear, ask the instructor!

3

Referenzen

ÄHNLICHE DOKUMENTE

Kind of code classifies the code which must be changed to achieve modifications into: source code, byte code (intermediate code of platform independent languages) and native binary

Gabriele R¨ oger (University of Basel) Theory of Computer Science April 24, 2019 2 / 38?.

lilfordi was mainly insectivorous, even though it contained an important contribution by vegetal matter, which was present in more than 50% of the pellets exam- ined (Tab. In

• To ensure statistical soundness of the throughput, compute the average runtime per query, the overall runtime should be more than one minute, and the client program generating

Compare clustered B + -tree, non-clustered B + -tree, non-clustered hash index, and table scan (no index) for the following queries and measure the throughput:.. SELECT * FROM

Compare clustered B + -tree, non-clustered B + -tree, non-clustered hash index, and table scan (no index) for the following queries and measure the throughput:.. SELECT * FROM

All error signals of a CPU except for the integer units are OR-ed together in a single error counter, as they are in a series composition. The error signals of the integer units

.method public abstract instance virtual void Lock() {}.