2

In this DDL syntax, does EXPIRE mean, SnappyData literally deletes the record(s) after this amount of time? Or, just expires it from local cache/memory, where it can be retrieved again from disk later?

CREATE TABLE [IF NOT EXISTS] table_name
   (
  COLUMN_DEFININTION
   )
USING 'row | column'
OPTIONS (
COLOCATE_WITH 'table_name',  // Default none
PARTITION_BY 'PRIMARY KEY | column name', // If not specified it will be a replicated table.
BUCKETS  'NumPartitions', // Default 113
REDUNDANCY        '1' ,
RECOVER_DELAY     '-1',
MAX_PART_SIZE      '50',
EVICTION_BY ‘LRUMEMSIZE 200 | LRUCOUNT 200 | LRUHEAPPERCENT,
PERSISTENT  ‘DISKSTORE_NAME ASYNCHRONOUS | SYNCHRONOUS’, //empty string will map to default diskstore
OFFHEAP ‘true | false’ ,
**EXPIRE ‘TIMETOLIVE in seconds'**,
)
Jason
  • 2,006
  • 3
  • 21
  • 36
  • Hi Jason, the answer to your question may be here: http://rowstore.docs.snappydata.io/docs/reference/language_ref/ref-create-table-clauses.html#topic_CAC4F2742DDE4B8FB0948E8EEB5A1E13 (ctrl+f) for "EXPIRE," one of our engineers will have to verify – plamb Aug 04 '16 at 20:02
  • The docs are still unclear, perhaps because Snappy Store tables can be either in-memory only or persistent. Let me re-phrase my question. In a PERSISTENT table, does EXPIRE delete the entry from a disk store forever? – Jason Aug 04 '16 at 20:12

1 Answers1

0

EXPIRE causes the records to be deleted permanently after specified TIMETOLIVE. If you want to only remove the entry from MEMORY and keep them on disk you would want to use EVICTION properties. For more on EVICTION please see

http://rowstore.docs.snappydata.io/docs/developers_guide/topics/cache/cache.html

suranjan
  • 447
  • 2
  • 4