MIGRATING()

Documentation

VoltDB Home » Documentation » Using VoltDB

MIGRATING()

MIGRATING() — Identifies table rows currently migrating to an export target.

Synopsis

MIGRATING()

MIGRATING

Description

The MIGRATING function identifies rows of a table that are currently being migrated to an export target.

If a table declaration includes the MIGRATE TO TARGET clause, when the migration is triggered (either by the USING TTL clause or an explicit MIGRATE statement), the row's contents are queued for export to the specified export target. Until the export is completed and acknowledged, the row remains in the database but marked for deletion. Once the export is acknowledged, the row is deleted. The MIGRATING function lets you identify rows that have expired but not completed the export action.

The MIGRATING function can only be used in the WHERE clause under the following conditions:

  • The selection expression selects from only one table.

  • The table in question is declared with MIGRATE TO TARGET.

Examples

The following example selects records for a particular customer where the records are currently being migrated to an export target.

SELECT * FROM Requests WHERE customer=? AND MIGRATING;

The next example performs the opposite operation — selecting only those records that are not currently being migrated.

SELECT * FROM Requests WHERE customer=? AND NOT MIGRATING;