Book Contents

Book Index

Next Topic

Home

SQL Overview

SQL (Structured Query Language) is a widely-used, industry standard data definition and data manipulation language for relational databases.

Vertica Support for ANSI SQL Standards

Vertica SQL supports a subset of ANSI SQL 99. Over time, Vertica SQL will enlarge and eventually converge with ANSI SQL 99. For information about ANSI SQL 99 see:

Vertica Use of PostgreSQL

In addition to using vsql as an interactive front-end, Vertica SQL supports a subset of the PostgreSQL language definition. For information about PostgreSQL see:

Vertica Major Extensions to SQL

Vertica provides several extensions to SQL that allow you to use the unique aspects of its column store architecture:

Support for Historical Queries

Unlike most databases, the DELETE command in Vertica does not actually delete data; it simply marks tuples as deleted. The UPDATE command actually does an INSERT and a DELETE. This behavior is necessary for historical queries. You can control how much historical data is stored on disk.

Non-Standard Syntax and Semantics

In case of non-standard SQL syntax or semantics, Vertica SQL follows Oracle whenever possible. For Oracle SQL documentation, you will need a web account to access the library:

Joins

Vertica supports:

Vertica does not support:

Transactions

Vertica supports conventional SQL transactions with standard ACID properties. Specifically:

Session-Scoped Isolation Levels

Vertica supports a subset of the standard SQL isolation levels and access modes for a user session as described in SERIALIZABLE Isolation and READ COMMITTED Isolation. These modes determine what data a transaction can access when other transactions are running concurrently. You can change the default isolation level for a user session using the SET SESSION CHARACTERISTICS command.

Session-scoped isolation levels do not apply to temporary tables, which are scoped to the current transaction. They do not take table locks, are only visible to one user, and their contents are always visible regardless of advancing epochs and COMMITs.

Query-Scoped Isolation Levels

Snapshot Isolation (historical queries) are part of the Vertica query syntax:

[ AT EPOCH LATEST ] | [ AT TIME 'timestamp' ] SELECT ...

AT EPOCH LATEST allows queries to access all historical data up to but not including the current epoch . It does not hold locks and does not block write operations. This provides a profound query performance advantage. It does not apply to temporary tables.

Automatic Rollback

When an error occurs or a user session is disconnected, the current transaction automatically rolls back. This behavior may be different from other databases.