Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
* add start_timestamp
* add fingerprint to the order by
* remove one of the ID columns and add is_continuous
  • Loading branch information
viglia committed Sep 12, 2024
1 parent 7b1a636 commit b6a82fc
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@

columns: List[Column[Modifiers]] = [
Column("project_id", UInt(64)),
# profile_id is nullable since this will only be used by transaction-based profiling
Column("profile_id", UUID(Modifiers(nullable=True, low_cardinality=False))),
# profiler_id is nullable since this will only be used by continuous profiling
Column("profiler_id", UUID(Modifiers(nullable=True, low_cardinality=False))),
Column("is_continuous", UInt(8)),
# transaction_name is nullable since this will only be used by transaction-based profiling
Column("transaction_name", String(Modifiers(nullable=True, low_cardinality=True))),
Column("fingerprint", UInt(64)),
Expand All @@ -27,6 +25,7 @@
Column("max", Float(64)),
Column("sum", Float(64)),
Column("count", UInt(64)),
Column("start_timestamp", DateTime()),
Column("end_timestamp", DateTime()),
Column("platform", String(Modifiers(low_cardinality=True))),
Column("environment", String(Modifiers(nullable=True, low_cardinality=True))),
Expand All @@ -46,7 +45,7 @@ def forwards_ops(self) -> Sequence[SqlOperation]:
table_name=local_table_name,
columns=columns,
engine=table_engines.MergeTree(
order_by="(project_id, end_timestamp)",
order_by="(project_id, fingerprint, start_timestamp)",
partition_by="(retention_days, toMonday(end_timestamp))",
settings={"index_granularity": "8192"},
storage_set=storage_set_name,
Expand Down

0 comments on commit b6a82fc

Please sign in to comment.