-
Notifications
You must be signed in to change notification settings - Fork 2
Schema
Liam Brandt edited this page Nov 8, 2018
·
1 revision
Table Format
TABLE_NAME (
COLUMN1_NAME type,
COLUMN2_NAME type,
…
PRIMARY KEY ((PARTITION_KEY), (CLUSTERING_KEY))
) WITH CLUSTERING ORDER BY (COLUMN_NAME CLUSTERING_DIRECTION)
This table is for making the index page more efficient. It allows for access of only one partition to get the latest snapshot of every system owned by one tenant.
Should be used on:
- System index page
latest_snapshots_by_tenant(
tenant text,
serial_number int,
Snapshot blob,
PRIMARY KEY ((tenant), (serial_number))
) WITH CLUSTERING ORDER BY (serial_number DESC)
This table is for querying for a specific system’s snapshot at some point in time. It should allow the query to only have to search one partition for a given system.
Should be used on:
- System view page
- System history?
snapshots_by_serial_number (
tenant text,
serial_number int,
time timestamp,
snapshot blob,
PRIMARY KEY ((tenant, serial_number), (time))
) WITH CLUSTERING ORDER BY (time DESC)