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
refactor: create tables via /api/v3/configure/table, drop __init seed rows
init.sh now POSTs each user table's tags + typed fields to
/api/v3/configure/table before creating caches and triggers, replacing the
old "write a __init sentinel row at t=1ns to materialize the table" pattern.
LVC/DVC creation and named UI queries need the table to exist at
plan/create time; explicit creation removes the race against implicit
first-write creation. Drops the matching `site <> __init` filters from
ui/queries.py and the andon plugin, and documents the pattern in
ARCHITECTURE.md, README.md, and influxdb/schema.md.
Copy file name to clipboardExpand all lines: README.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,11 @@ the JSON response. See `cache-last-compare` in `CLI_EXAMPLES.md`.
68
68
`distinct part_id` over today (~700K events at default config) returns in a few ms via the cache (vs. hundreds of ms scanning the table); exact latency depends on the query.
69
69
See `cache-distinct` in `CLI_EXAMPLES.md`.
70
70
71
+
> The LVC and DVC are bound to a *named* table that must already exist when
72
+
> `create last_cache` / `create distinct_cache` runs. `init.sh` creates each
73
+
> user table explicitly via `POST /api/v3/configure/table` before creating the
74
+
> caches — see `ARCHITECTURE.md` § "Table creation: explicit, not implicit".
A 201 means the table was created; a 409 means it already exists (idempotent re-run).
35
+
Field types: `float64`, `int64`, `uint64`, `utf8`, `bool`. This avoids the older
36
+
"write a sentinel row at t=1ns with `__init` tag values to materialize the table"
37
+
hack — that pattern leaves a permanent throwaway row in every table that all queries
38
+
must filter out.
7
39
8
40
## Tables
9
41
@@ -18,6 +50,10 @@ triggers.
18
50
19
51
## Caches
20
52
53
+
Both caches are created in `init.sh`*after* the explicit table creation above —
54
+
`create last_cache` and `create distinct_cache` resolve their `--table` argument
55
+
against the catalog, so the table must already exist.
56
+
21
57
-**Last Value Cache**`machine_state_last` on `machine_state` keyed by (site, line_id, station_id, machine_id) — 24-row in-memory cache that powers the plant-state banner and is read by `request_andon_board` to assemble the andon JSON. Single-digit-ms per-machine lookup (exact latency depends on the query).
22
58
-**Distinct Value Cache**`part_id_distinct` on `part_events.part_id` — accelerates the "distinct parts today" KPI. Demonstrated explicitly in `cache-distinct` CLI example.
0 commit comments