CREATE MEMORY STORE Statement

Creates a named memory store that one or more windows can be assigned to. Is not required but can be used for performance optimization.

Syntax

CREATE [DEFAULT] MEMORY STORE storename
[PROPERTIES
[INDEXTYPE={'tree'|'hash'},]
[INDEXSIZEHINT=size]]

Properties

INDEXTYPE

The type of index mechanism for the stored elements. The default is 'tree'. Use tree for binary trees. Binary trees are predictable in use of memory and consistent in speed. Use hash for hash tables, as hash tables are faster, but they often consume more memory.

INDEXSIZEHINT

(Optional) Determines the initial number of elements in the hash table, when using hash. The value is in units of 1024. Setting this higher consumes more memory, but reduces the chances of spikes in latency. Default is 8KB.

Components

storename An identifier that can be referenced in the STORE clause of stateful elements. Must be unique.
'tree' Default index mechanism.
'hash' Alternative index mechanism.

Usage

A memory store holds all the retained records for one or more windows. The data is held in memory and does not persist on the disk. The INDEXTYPE property is optional, and the store supports 'tree' or 'hash' index types. If you do not specify the index type and size properties, the store refers to their default values.

Specify properties in the PROPERTIES clause, but this clause is optional for memory stores, since all its properties are optional. Properties may be specified in any order.

You cannot specify memory stores properties for log stores, or log store properties for memory stores.

If you specify DEFAULT, the store is the default store for the module or project. The store is used for stateful elements that do not explicitly specify a store with a STORE clause. When a store is not defined for the project or module, a default memory store is automatically created for holding the stateful elements.

Example

CREATE DEFAULT MEMORY STORE Store1 PROPERTIES INDEXTYPE='hash', INDEXSIZEHINT=16;