Skip to content

Commit b422f60

Browse files
committed
fix(clickhouse): defer ephemeral event attributes
1 parent b759825 commit b422f60

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

internal-packages/clickhouse/schema/042_reduce_task_events_v2_storage_overhead.sql

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
-- Full-text search is served outside the source event table. Keeping these
44
-- indexes here adds work to every event insert and merge without serving reads.
5-
-- attributes remains an insert input for attributes_text, but is no longer
6-
-- stored. Writers must include attributes in an explicit insert column list
7-
-- because implicit INSERT column lists exclude EPHEMERAL columns.
85
ALTER TABLE trigger_dev.task_events_v2
9-
MODIFY COLUMN attributes JSON EPHEMERAL,
106
DROP INDEX IF EXISTS idx_attributes_text_search,
117
DROP INDEX IF EXISTS idx_attributes_text,
128
DROP INDEX IF EXISTS idx_message_text_search,
@@ -15,6 +11,6 @@ SETTINGS mutations_sync = 2, alter_sync = 2;
1511

1612
-- +goose Down
1713

18-
-- Restoring the stored JSON column safely requires inspecting the live schema
19-
-- and coordinating the writer rollback. Use a new forward migration instead.
14+
-- Restoring these indexes safely requires selecting the appropriate index
15+
-- definitions and materializing them in a new forward migration.
2016
SELECT throwIf(1, 'This migration cannot be rolled back automatically');

0 commit comments

Comments
 (0)