GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • V4.x Documentation
  • Contact
  • Privacy Statement
  • Contributor License Agreement
  • Software License Agreement
  • Trademarks

This view

  • Original page
  • New address

GeezerVison is showing docs.voltdb.com — CURRENT_TIMESTAMP

  • VoltDB Home
  • Forums
  • V4.x Books
    • VoltDB Tutorial
    • Using VoltDB
    • VoltDB Performance Guide
    • VoltDB Planning Guide
    • VoltDB Administrator's Guide
  • Current docs ▶
CURRENT_TIMESTAMP

Documentation

VoltDB Home » Documentation » Using VoltDB
< previoustable of contentsnext >

CURRENT_TIMESTAMP

CURRENT_TIMESTAMP — Returns the current time as a timestamp value.

Synopsis

CURRENT_TIMESTAMP

Description

The CURRENT_TIMESTAMP function returns the current time as a VoltDB timestamp. The value of the timestamp is determined when the query or stored procedure is invoked. Several important aspects of how the CURRENT_TIMESTAMP function operates are:

  • The value returned is guaranteed to be identical for all partitions that execute the query.

  • The value returned is measured in milliseconds then padded to create a timestamp value in microseconds.

  • During command logging, the returned value is stored as part of the log, so when the command log is replayed, the same value is used during the replay of the query.

  • Similarly, for database replication (DR) the value returned is passed and reused by the replica database when replaying the query.

  • You can specify CURRENT_TIMESTAMP as a default value in the CREATE TABLE statement when defining the schema of a VoltDB database.

  • The CURRENT_TIMESTAMP function cannot be used in the CREATE INDEX or CREATE VIEW statements.

The NOW and CURRENT_TIMESTAMP functions are synonyms and perform an identical function.

Example

The following example uses CURRENT_TIMESTAMP in the WHERE clause to delete alert events that occurred in the past:

DELETE FROM Alert_event WHERE event_timestamp < CURRENT_TIMESTAMP;
< previoustable of contentsnext >
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.