You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- core_data.device_info is used to store the device related information reusing in the event and reading
CREATE TABLE IF NOT EXISTS core_data.device_info (
id SERIAL PRIMARY KEY,
devicename TEXT,
profilename TEXT,
sourcename TEXT,
tags JSONB,
resourcename TEXT,
valuetype TEXT DEFAULT '',
units TEXT DEFAULT '',
mediatype TEXT
);
-- core_data.event is used to store the event information
CREATE TABLE IF NOT EXISTS core_data.event (
id UUID,
origin BIGINT,
device_info_id SERIAL
);
CREATE UNIQUE INDEX IF NOT EXISTS idx_event_id_origin
ON core_data.event(id, origin);
-- core_data.reading is used to store the reading information
CREATE TABLE IF NOT EXISTS core_data.reading (
event_id UUID,
device_info_id SERIAL,
origin BIGINT,
value TEXT,
binaryvalue BYTEA,
objectvalue JSONB
);
CREATE INDEX IF NOT EXISTS idx_reading_origin
ON core_data.reading(origin);
The text was updated successfully, but these errors were encountered:
🚀 Feature Request
Relevant Package [REQUIRED]
This feature request is for core-dataDescription [REQUIRED]
A clear and concise description of the problem or missing capability...The event and reading contain lots of repeat fields we can extract them to another table to reduce the disk space.
Describe the solution you'd like
map[key]device_info_id
to cache the device_info for checking wether the event or reading device info fields existFor example, when receiving the event reading below, we can
deviceName
,profileName
,sourceName
,tags
in thedevice_info
for theevent
deviceName
,profileName
,resourceName
,valueType
in thedevice_info
for thereading
The text was updated successfully, but these errors were encountered: