You are on page 1of 2

Vertica Essentials – Optimizing the DB Design Hands-On Lab Exercise

Exercise 1: Time a query in Management Console

Introduction
In this exercise, you will:

 Use the Management Console to create a comprehensive database design.


 The design should provide balanced performance between data loading and query speed.
 Review the design output script.
 Save the script

Exercise
Step Task
1 From the Management Console (MC), select the Go to database action under the Recent
Databases section, then select the Query Execution tab at the bottom of the MC
Overview screen.
2 Execute the following query:

SELECT DISTINCT
s.product_key,
p.product_description
FROM
store.STORE_SALES_FACT s,
public.PRODUCT_DIMENSION p
WHERE
s.product_key = p.product_key AND
s.product_version = p.product_version AND
s.store_key IN
(
SELECT
store_key
FROM
store.STORE_DIMENSION
WHERE
store_state = 'MA'
)
ORDER BY
s.product_key
LIMIT 1000;

3 Record the query execution time from the bottom of the Query Results tab
4 Select the Design tab from the bottom of the Management Console window
5 From the New Design screen, name this design VMartDesign and click the Wizard button.
6 Select the design type of Comprehensive, and click the Next button.
Q1 Other than Comprehensive, what other type of Design Type is available?
7 Select the optimization objective Balance Load and Performance, then click the Next
button.
8 Select all three database schemas (public, store and online_sales) for optimization, then
click the Next button.

v0_1 Page: 1
Vertica Essentials – Optimizing the DB Design Hands-On Lab Exercise

9 Set the K-safety of the suggested optimized projections to 1, and allow the DBD to
propose unsegmented projections. For this design, the DBD should ignore column
correlations. Click the Next button.
Q2 Other than 1 for the K-Safety of the database, from the pull-down list, what other options
are available?
10 From the Select Queries step, click the Browse… button, and select the query file
vmart_queries.sql from the Class Files folder on the Windows desktop. Click the Next
button.
11 From Execution Options, select Analyze Statistics and Auto-Build. Click the Next button.
12 Review the configuration in Summary, then click the Submit Design button.
13 Review the details in the Event History tab.
14 Wait for the design build to complete (Built).
Q3 From the Event History, which of the following stages was performed first – “Optimizing
query performance” or “Optimizing storage footprint”?
15 Review the details from the Output subtab on the Design page.
16 Click the Export Design button at the top of the page (noting it may take a few moments
to become active), and then save the file to your desktop.
17 Open the file from there using WordPad or other text editor and review its contents.
18 Review the output in the Queries tab.
Q4 How many queries are reported in the Queries tab?
19 Review the output in the Tables tab.

v0_1 Page: 2

You might also like