Skip to content

SQLAdapter for the One Big Table #1053

@DiamondJoseph

Description

@DiamondJoseph

Following #778 and the additional tightening up of the SQLAdapter in #1047, we believe we can implement Diamond's desires for a single big table by providing an alternative implementation of the SQLAdapter. We would like an adapter that stores all bluesky run data into a single long but not wide table

From Diamond's perspective, we have been thinking about the Big Table differently, which I am writing here for completeness. From the very beginnings of testing, value is a JSONB field, which (from some simple experimentation) seems to work OK

The Big Table

uid run_uid stream field_name seq_num value
42 . . . . .
43 . . . . .
44 . . . . .
CREATE TABLE points(uid SERIAL PRIMARY KEY, run_id CHAR(32), axis Char(32), val JSONB);
INSERT INTO points (run_id, axis, val) VALUES('qwert', 'x', '1.5');
INSERT INTO points (run_id, axis, val) VALUES('qwert', 'robot', '"foo"');
INSERT INTO points (run_id, axis, val) VALUES('qwert', 'shutter', 'true');

SELECT * FROM points WHERE val @@ '$ <3';

Originally posted by @DiamondJoseph in #778

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions