I’m on GridDB Cloud (Free). For a TimeSeries container, I want each device to have at most one row per timestamp, i.e., enforce uniqueness on (ts, deviceid)
.
Schema:
CREATE TABLE TSDB (
ts TIMESTAMP PRIMARY KEY, -- row key
deviceid STRING,
temperature DOUBLE
) USING TIMESERIES;
Question:
Does GridDB TimeSeries support a composite primary key like (ts, deviceid)
(or a UNIQUE (ts, deviceid)
constraint), or is ts
the only allowed row key? If composites aren’t supported, what’s the recommended pattern to enforce one row per device per timestamp (e.g., modeling or indexing approach)?
Environment:
- GridDB Cloud (Free)
- SQL console.