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

  • V7.x Documentation
  • Privacy Statement
  • License Agreement
  • Contact Us

This view

  • Original page
  • New address

GeezerVison is showing docs.voltdb.com — TRUNCATE TABLE

  • Volt Active Data
  • Feedback/Discuss
  • V7.x Books
    • VoltDB Tutorial
    • Using VoltDB
    • VoltDB Guide to Performance and Customization
    • VoltDB Planning Guide
    • VoltDB Administrator's Guide
  • Current docs ▶
TRUNCATE TABLE

Documentation

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

TRUNCATE TABLE

TRUNCATE TABLE — Deletes all records from the specified table.

Synopsis

TRUNCATE TABLE table-name

Description

The TRUNCATE TABLE statement deletes all of the records from the specified table. TRUNCATE TABLE is the same as the statement DELETE FROM {table-name} with no selection clause. These statements contain optimizations to increase performance and reduce memory usage over an equivalent DELETE statement containing a WHERE selection clause.

The following behavior is important to remember when using the TRUNCATE TABLE statement in VoltDB:

  • Executing a TRUNCATE TABLE query on a partitioned table within a single-partitioned stored procedure will only delete the records within the current partition. Records in other partitions will be unaffected.

  • You cannot execute a TRUNCATE TABLE query on a replicated table from within a single-partition stored procedure. To truncate a replicated table you must execute the query within a multi-partition stored procedure or as an ad hoc query.

Examples

The following example removes all data from the CURRENT_STANDINGS table:

TRUNCATE TABLE Current_standings;
< previoustable of contentsnext >
You are visitor 01402775 — 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.