-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Pitch
@coderabbitai's review at #330 (review) yielded this recommendation.
63-76
: Align table types with arrays and avoid TIMESTAMPTZ ambiguity.CrateDB handles TIMESTAMP in UTC; storing arrays as arrays eases querying (unnest/ANY). Also keep the generated monthly partition.
CREATE TABLE doc.collectd_data (
- p_time timestamp with time zone,
- p_host TEXT,
- p_plugin TEXT,
- p_plugin_instance TEXT,
- p_type TEXT,
- p_type_instance TEXT,
- p_value_names TEXT,
- p_type_names TEXT,
- p_values TEXT,
- month GENERATED ALWAYS AS date_trunc('month',p_time)
+ p_time TIMESTAMP,
+ p_host TEXT,
+ p_plugin TEXT,
+ p_plugin_instance TEXT,
+ p_type TEXT,
+ p_type_instance TEXT,
+ p_value_names ARRAY(TEXT),
+ p_type_names ARRAY(TEXT),
+ p_values ARRAY(DOUBLE PRECISION),
+ month GENERATED ALWAYS AS date_trunc('month', p_time)
) PARTITIONED BY (month);
References
Metadata
Metadata
Assignees
Labels
No labels