Book Contents

Book Index

Next Topic

Home

Writing Queries

In general, Vertica is designed to execute the same SQL standard queries that run on other databases. However, there are several differences between Vertica queries and those used in other relational database management systems:

IMPORTANT - QUERY PERFORMANCE

Explanation

By default, queries do not use snapshot isolation and thus hold locks on the projections associated with the tables in the SELECT list. This blocks other database operations (concurrent queries) until the transaction ends.

Workaround

Unless you need the result set of your query to include data from the current epoch, use:

AT EPOCH LATEST SELECT ...

If you need the result set of your query to include data from the current epoch, end the current transaction as soon as possible. This can be done by executing COMMIT or ROLLBACK or terminating the connection.

Explanation

Because Vertica does not support cursors, a query that produces a large result set can consume a great deal of client resources.

Workaround

  • Add predicates to the query to reduce the size of the result set.

    Use the LIMIT clause (described in the SQL Reference Manual) to reduce the size of the result set.

In This Chapter

Using Temporary Tables

Using Compound Predicate Joins

Using Multiple Instances of Dimension Tables in the FROM Clause

Using Outer Joins