Vertica Community Edition Virtual Machine User Guide
Vertica Community Edition Virtual Machine User Guide
Legal Notices
Warranty
The only warranties for Micro Focus or one of its affiliates products and services are set forth in the express
warranty statements accompanying such products and services. Nothing herein should be construed as
constituting an additional warranty. Micro Focus shall not be liable for technical or editorial errors or
omissions contained herein.
Copyright Notice
© Copyright 2007 - 2020 Micro Focus or one of its affiliates
Trademark Notices
Adobe™ is a trademark of Adobe Systems Incorporated.
Apache® Hadoop® and Hadoop are either registered trademarks or trademarks of the Apache Software
Foundation in the United States and/or other countries.
This product includes an interface of the 'zlib' general purpose compression library, which is Copyright ©
1995-2002 Jean-loup Gailly and Mark Adler.
Warranty 2
Copyright Notice 2
Trademark Notices 2
Is VMart in Compliance? 17
Query Execution 19
Start vsql 34
Exit vsql 39
Documentation references with each example will help you learn how to find the
information you need when you need it.
Important:
To benefit from the documentation references in this document, you must
download and install the Vertica documentation. Follow the instructions in
Get Started with the Vertica Community Edition VM.
If you read this document on the Vertica website, the documentation links
will not work.
Note:
The Vertica CE VM is available in two virtualization formats: one for
VMware, the other for Oracle VM VirtualBox.
Important:
The documentation ZIP file contains the entire Vertica
documentation set. The documentation links in this user guide only
work when the Vertica documentation is installed locally in the VM.
Vertica-user-doc_10.0.x-for-download.zip
l VirtualBox: You will download the documentation later as explained in Install the
Vertica Documentation on VirtualBox.
Note:
On initial startup only, VMware displays this message. Click I
copied it to dismiss the message.
Password: password
Important:
You must be logged in as dbadmin.
2. Navigate to the location where you downloaded the Vertica documentation ZIP file on
your computer. The name of the ZIP file is:
Vertica-user-doc_10.0.x-for-download.zip
$ cd /home/dbadmin/Vertica_Docs/
$ unzip Vertica-user-doc_10.0.x-for-download.zip -d /home/dbadmin/Vertica_Docs/
/home/dbadmin/Vertica_Docs/
Get started Get Started With Get Started with Get Started
Management Console Administration Tools with vsql
Tip:
See Administration Tools and Management Console in the Vertica
documentation for a detailed comparison of the functionality in
Management Console and Administration Tools.
2. Click the Login button to log in with the credentials supplied in the dialog box:
Username: uidbadmin
Password: password
The links in the dialog box are URLs to the Vertica documentation on the Vertica website. If
you have a network connection and the VM recognizes it, you can click the links to view the
documentation. However, we recommend that you skip this exploration step until you have
completed the exercises in this document. If you have loaded the Vertica documentation
into the VM, you can find these same topics locally in the VM.
To close the dialog box, simply click OK. On subsequent logins, you can suppress the dialog
box by clicking Do not display this message again.
Under Recent Databases, we see the VMart example database, which was created and
imported into MC as part of VM creation.
NEXT STEP: Under Manage, click View Your Infrastructure to open the Infrastructure
page.
NEXT STEP: Click View to open the Overview page for VMart.
ACTIONS:
NEXT STEP: Click the Manage tab at the bottom of the page.
If you select Memory Utilization from the KPI View drop-down list, VMart displays as
yellow, indicating that its status is CRITICAL. Even before making a selection, VMart may
display as yellow. Why? The Vertica CE VM hosts a single node cluster, but a minimum of
three nodes is required for high availability. MC considers the status of VMart to be critical,
because if the node goes down then the database will be down.
To learn about high availability in Vertica, read the topic on K-Safety in the Vertica
documentation.
ACTIONS:
NEXT STEP: Click the License tab to view the status of the license for VMart.
Is VMart in Compliance?
The License tab displays information about database licensing and compliance. On this tab,
you can monitor license usage over time and be prepared if expiration is pending or if
you're approaching the maximum allowable data size.
Questions:
ACTIONS: Click each option on the side menu and note the controls and settings for each
one.
Query Execution
After you click the Query Execution tab, the SQL window opens. In this window, you can run
SQL statements in the Vertica database. Key components of the SQL window include:
l Query History—A recall window, where MC saves SQL statements after they are
executed. You can recall and rerun any of the SQL stored in the recall window.
l Edit window—A window where you can specify SQL statements. You can type SQL,
paste it from the recall window, or import it from a file.
l Execute Query bar—Click this bar to execute the query in the edit window.
l Results window—A window where the results of SQL execution are posted. In this
pane, there are also actions you can perform based on SQL results. For example: you
can export the results to a csv file.
ACTIONS:
5. Click Export Data to export the query results to a csv file, pipe it directly into
LibreOffice Calc, or save it to a file.
1. Clear the edit window and results window by clicking the Clear button (eraser icon).
2. In the edit window, type:
select version()
You can type multiple SQL commands in the edit window. Terminate each command
with a semicolon. MC parses the commands and executes them individually. Each
command has its own result set tab in the results window.
1. Click the eraser icon to clear the edit window and results window.
2. Click the Import SQL Script icon.
3. Select the example_vmart_query_02.sql file and click Open. If the file is not
visible, navigate to /opt/vertica/examples/VMart_Schema.
4. Click the Execute Query bar to run the SQL and generate the result set in the results
window.
NEXT STEPS:
1. Click the Query Profile tab in the results window to display th profile associated with
the query you just ran.
The query profile does not display, because profiles are not generated automatically
for queries that run in less that one second.
4. To see more of the query profile data, click View more profile information.
Note:
If you click the Explain or Profile button on the Query Plan page,
Management Console refreshes the text of the query, including the
keyword PROFILE. This behavior causes an error, as shown:
To work around this error, simply delete the PROFILE keyword from
the text of the query and click the Explain or Profile button a second time.
1. After you profile the query and review the path information, note that NO STATISTICS
appears in red. Note also the Cost and Rows detail, which is generated by the Vertica
Optimizer. Cost is the estimated cost of the query. Rows is the number of rows to be
returned for that specific step of the query execution.
+-JOIN HASH [Semi] [Cost: 1K, Rows: 75K (NO STATISTICS)] (PATH ID: 1)
+-- Outer -> JOIN HASH [Anti][NotInAnti] [Cost: 732, Rows: 150K (NO STATISTICS)] (PATH
ID: 2)
+-- Outer -> STORAGE ACCESS for orders [Cost: 546, Rows: 300K (NO STATISTICS)] (PATH ID:
3)
+---> STORAGE ACCESS for vendor_dimension [Cost: 10, Rows: 25 (NO STATISTICS)] (PATH ID:
5)
+---> STORAGE ACCESS for store_dimension [Cost: 10, Rows: 125 (NO STATISTICS)] (PATH ID:
7)
Without statistics, the optimizer may not plan an efficient execution of the query.
select analyze_statistics('')
3. Clear the screen, then recall the query labeled query2 and execute it.
Note:
The cost values have increased slightly, but the number of rows
returned has decreased significantly. This means that the optimizer is
doing a more efficient job of returning only rows meeting the filter
criteria, which should equate to faster times and less memory usage.
NO STATISTICS:
+-JOIN HASH [Semi] [Cost: 1K, Rows: 75K (NO STATISTICS)] (PATH ID: 1)
+-- Outer -> JOIN HASH [Anti][NotInAnti] [Cost: 732, Rows: 150K (NO STATISTICS)] (PATH
ID: 2)
+-- Outer -> STORAGE ACCESS for orders [Cost: 546, Rows: 300K (NO STATISTICS)] (PATH ID:
3)
+---> STORAGE ACCESS for vendor_dimension [Cost: 10, Rows: 25 (NO STATISTICS)] (PATH ID:
5)
+---> STORAGE ACCESS for store_dimension [Cost: 10, Rows: 125 (NO STATISTICS)] (PATH ID:
7)
WITH STATISTICS
ACTIONS:
1. At the bottom of the page, click the Overview tab. If the Status Summary page is not
displayed, click the monitor icon on the upper left.
2. In the CPU/Memory/Disk I/O section, hover over the Avg Mem Usage (%) line in the
line graph.
3. Observe the additional details for this point in time.
4. Click a point in the timeline to open an exploded view of this time.
5. Click the Back arrow in your browser to return to the Status Summary page.
l Management Console
l Using Management Console
You can use Administration Tools within an interactive graphical user interface, or you can
use the command line. The command line is useful for scripting.
Tip:
The vsql commands in these examples are stored in the command history
buffer in the VM. Instead of typing a command, you can press the Up arrow
and select it from the list.
The database status displays. We see that the VMart database is up and that all host
computers are running.
5. On the Select database to view screen, press the space bar to select VMart and click
OK.
6. Click OK.
7. Scroll to option M Main Menu, then click OK.
4. To exit vsql and return to the Administration Tools GUI, type \q.
5. To exit the Administration Tools GUI, select option E Exit and click OK.
This command returns the following, indicating that the VMart database is running:
VMart
Database: VMart
Database Log: /vertica/data/VMart/dbLog, /vertica/data/VMart/v_vmart_node0001_
catalog/vertica.log
Hosts: 127.0.0.1
Restart Policy: always
Port: 5433
Catalog Directory: /vertica/data/VMart/v_vmart_node0001_catalog
[dbadmin@localhost ~]$
2. To get help on a specific tool, type a command like the one shown here for the list_
node tool:
l Administration Tools
l Using the Administration Tools
Tip:
The vsql commands in these examples are stored in the command history
buffer in the VM. Instead of typing a command, you can press the Up arrow
and select it from the list.
Start vsql
1. Right-click the desktop and select Open Terminal.
2. Change to the directory that contains the VMart example scripts used in this exercise:
dbadmin=> \d
List of tables
Schema | Name | Kind | Owner | Comment
-------------+----------------- -----+-------+---------+--------
online_sales | call_center_dimension | table | dbadmin |
online_sales | online_page_dimension | table | dbadmin |
online_sales | online_sales_fact | table | dbadmin |
public | customer_dimension | table | dbadmin |
public | date_dimension | table | dbadmin |
public | employee_dimension | table | dbadmin |
public | inventory_fact | table | dbadmin |
public | product_dimension | table | dbadmin |
public | promotion_dimension | table | dbadmin |
public | shipping_dimension | table | dbadmin |
public | vendor_dimension | table | dbadmin |
public | warehouse_dimension | table | dbadmin |
store | store_dimension | table | dbadmin |
store | store_orders_fact | table | dbadmin |
store | store_sales_fact | table | dbadmin |
(15 rows)
Note:
\d is an example of a meta-command in vsql. Meta-commands begin
with an unquoted backslash character and are processed by vsql
itself. These commands help make vsql more useful for
administration or scripting.
dbadmin=> \dS
List of tables
Schema | Name | Kind | Description
|Comment
----------+----------------- +-------+---------------------------------------------------
+-----------
v_catalog |access_policy |system |Access Policy information
|
v_catalog |all_tables |system |A complete listing of all tables and views
|
v_catalog |client_auth |system |Client Authentication Detailed information
|
v_catalog |client_auth_params|system |Client Authentication Paramters
|
v_catalog |cluster_layout |system |Current cluster layout with relative order of
nodes|
v_catalog |columns |system |Table column information
|
v_catalog |comments |system |User comments on catalog objects
|
v_catalog |constraint_columns|system |Table column constraint information
|
v_catalog |databases |system |Database information
|
v_catalog |directed_queries |system |Directed queries
|
.
.
.
To view more output, press the space bar. To quit displaying output, type q.
projection_name | sum
---------------------+-----
(0 rows)
dimensions:
dbadmin=> \i /opt/vertica/examples/VMart_Schema/vmart_load_online_sales_data.sql
Rows Loaded
-------------
1000
(1 row)
Rows Loaded
-------------
200
(1 row)
Rows Loaded
-------------
5000000
(1 row)
3. Rerun the query of the system table projection_storage to see the effect of the data
load:
Press the Up arrow repeatedly until you find the following command. Select it to
execute the command from History.
projection_name | sum
-----------------------------+---------
call_center_dimension_super | 200
online_page_dimension_super | 1000
online_sales_fact_super | 5000000
(3 rows)
Exit vsql
To exit vsql, type \q:
dbadmin-> \q
[dbadmin@localhost VMart_Schema]$
l Using vsql
l SQL in Vertica