perf: ⚡️ engine sort by id; pipe prefill ordered
This commit is contained in:
@@ -17,4 +17,4 @@ SCHEMA >
|
||||
|
||||
ENGINE "MergeTree"
|
||||
ENGINE_PARTITION_KEY "toYYYYMM(timestamp)"
|
||||
ENGINE_SORTING_KEY "org_id, env, timestamp, customer_id, event_name"
|
||||
ENGINE_SORTING_KEY "org_id, env, timestamp, id, customer_id, event_name"
|
||||
|
||||
@@ -2,7 +2,7 @@ DESCRIPTION >
|
||||
Materializes events into events_by_timestamp_mv for fast time-range listing.
|
||||
Copies all event columns without aggregation - just re-sorted by timestamp.
|
||||
|
||||
NODE materialize
|
||||
NODE transformation_node
|
||||
SQL >
|
||||
SELECT
|
||||
id,
|
||||
@@ -16,6 +16,7 @@ SQL >
|
||||
idempotency_key,
|
||||
entity_id
|
||||
FROM events
|
||||
|
||||
ORDER BY timestamp DESC, id DESC
|
||||
|
||||
TYPE materialized
|
||||
DATASOURCE events_by_timestamp_mv
|
||||
|
||||
Reference in New Issue
Block a user