Forum: Building VoltDB Applications

Post: Is it possible to EXPORT using Capped Collection?

Is it possible to EXPORT using Capped Collection?
interntest
Apr 22, 2015
The following schema is taken from http://docs.voltdb.com/UsingVoltDB/ddlref_createtable.php.


CREATE TABLE events (
event_time TIMESTAMP NOT NULL,
event_code INTEGER NOT NULL.
event_message VARCHAR(128),
LIMIT PARTITION ROWS 1000 EXECUTE (
DELETE FROM events WHERE
SINCE_EPOCH(second,NOW) - SINCE_EPOCH(second,event_time) > 24*3600
)
);

The above schema works perfectly. However, is it possible to do something like

CREATE TABLE events (
event_time TIMESTAMP NOT NULL,
event_code INTEGER NOT NULL.
event_message VARCHAR(128),
LIMIT PARTITION ROWS 1000 EXECUTE (

delete some deterministic data from events table
insert the deleted data into an EXPORT table.

)
);
bballard
Apr 23, 2015
Hi interntest,

What you propose is not currently supported, only DELETE statements on the same table may be used with LIMIT PARTITION ROWS ... EXECUTE.

In most cases, it is preferable to insert data into an EXPORT table upon ingestion, often within a stored procedure. This way the downstream system is current within seconds or less. To delay inserting into an EXPORT table until a partition row limit is reached, it could be very unpredictable how current the downstream system would be.

Do you agree?

Best regards,
Ben