Snapshot Isolation
Runs a SELECT query in snapshot isolation mode, which queries all data in the database up to and including the most recently closed (advanced)
epoch without holding a lock or blocking write operations. This provides a substantial query performance improvement over the default SERIALIZABLE Isolation level.
An epoch represents committed changes to the data stored in a database between two specific points in time. In other words, an epoch contains all COPY, INSERT, UPDATE, and DELETE operations that have been executed and committed since the end of the previous epoch.
Syntax
AT EPOCH LATEST SELECT...
Semantics
To be precise, a query using snapshot isolation is actually an
historical query. The syntax AT EPOCH LATEST
is equivalent to the syntax AT TIME '
timestamp'
where timestamp is known to be within the most recently closed epoch.
Vertica can execute a query from a snapshot of the database taken at a specific date and time. The syntax is:
AT TIME 'timestamp' SELECT...
The command queries all data in the database up to and including the
epoch representing the specified date and time without holding a lock or blocking write operations.
An epoch represents committed changes to the data stored in a database between two specific points in time. In other words, an epoch contains all COPY, INSERT, UPDATE, and DELETE operations that have been executed and committed since the end of the previous epoch.
Notes
- Snapshot isolation does not apply to temporary tables.
- The only disadvantage of using snapshot isolation mode is that queries cannot see data that has been commited within the current epoch (the epoch that has not yet been closed). Because the automatic tuple mover advances the epoch every three minutes by default, the query result set may be missing up to three minutes worth of newly loaded tuples.