Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(clickhouse): reconcile metrics2 timestamp index in hcl golden (#102640)

Tommy Gilmore8ce6ca3307fd
diff --git a/posthog/clickhouse/hcl/golden/dev/logs.hcl b/posthog/clickhouse/hcl/golden/dev/logs.hcl
index a825e2af2fc7..65e3474727ec 100644
--- a/posthog/clickhouse/hcl/golden/dev/logs.hcl
+++ b/posthog/clickhouse/hcl/golden/dev/logs.hcl
@@ -1848,6 +1848,11 @@ SQL
type = "minmax"
granularity = 1
}
+ index "idx_timestamp_minmax" {
+ expr = "timestamp"
+ type = "minmax"
+ granularity = 1
+ }
projection "projection_series_activity" {
query = <<SQL
SELECT
diff --git a/posthog/clickhouse/hcl/golden/local-multi/logs.hcl b/posthog/clickhouse/hcl/golden/local-multi/logs.hcl
index 0a5f53cae972..a4cf924c439a 100644
--- a/posthog/clickhouse/hcl/golden/local-multi/logs.hcl
+++ b/posthog/clickhouse/hcl/golden/local-multi/logs.hcl
@@ -2416,6 +2416,11 @@ SQL
type = "minmax"
granularity = 1
}
+ index "idx_timestamp_minmax" {
+ expr = "timestamp"
+ type = "minmax"
+ granularity = 1
+ }
projection "projection_series_activity" {
query = <<SQL
SELECT
diff --git a/posthog/clickhouse/hcl/golden/local-single/all.hcl b/posthog/clickhouse/hcl/golden/local-single/all.hcl
index e6fca9d6b893..bea9cff497a6 100644
--- a/posthog/clickhouse/hcl/golden/local-single/all.hcl
+++ b/posthog/clickhouse/hcl/golden/local-single/all.hcl
@@ -7290,6 +7290,11 @@ SQL
type = "minmax"
granularity = 1
}
+ index "idx_timestamp_minmax" {
+ expr = "timestamp"
+ type = "minmax"
+ granularity = 1
+ }
projection "projection_series_activity" {
query = <<SQL
SELECT
diff --git a/posthog/clickhouse/hcl/golden/prod-eu/logs.hcl b/posthog/clickhouse/hcl/golden/prod-eu/logs.hcl
index ce7ac64c0a31..79aace874660 100644
--- a/posthog/clickhouse/hcl/golden/prod-eu/logs.hcl
+++ b/posthog/clickhouse/hcl/golden/prod-eu/logs.hcl
@@ -2002,6 +2002,11 @@ SQL
type = "minmax"
granularity = 1
}
+ index "idx_timestamp_minmax" {
+ expr = "timestamp"
+ type = "minmax"
+ granularity = 1
+ }
projection "projection_series_activity" {
query = <<SQL
SELECT
diff --git a/posthog/clickhouse/hcl/golden/prod-us/logs.hcl b/posthog/clickhouse/hcl/golden/prod-us/logs.hcl
index 3003e1d95fdb..49b28da0e114 100644
--- a/posthog/clickhouse/hcl/golden/prod-us/logs.hcl
+++ b/posthog/clickhouse/hcl/golden/prod-us/logs.hcl
@@ -2002,6 +2002,11 @@ SQL
type = "minmax"
granularity = 1
}
+ index "idx_timestamp_minmax" {
+ expr = "timestamp"
+ type = "minmax"
+ granularity = 1
+ }
projection "projection_series_activity" {
query = <<SQL
SELECT
diff --git a/posthog/clickhouse/hcl/roles/logs/metrics/tables.hcl b/posthog/clickhouse/hcl/roles/logs/metrics/tables.hcl
index bc28422ddeaf..4ddfa0dd137e 100644
--- a/posthog/clickhouse/hcl/roles/logs/metrics/tables.hcl
+++ b/posthog/clickhouse/hcl/roles/logs/metrics/tables.hcl
@@ -702,6 +702,11 @@ SQL
type = "minmax"
granularity = 1
}
+ index "idx_timestamp_minmax" {
+ expr = "timestamp"
+ type = "minmax"
+ granularity = 1
+ }
projection "projection_series_activity" {
query = <<SQL
SELECT
diff --git a/posthog/clickhouse/hcl/sql/dev/logs.sql b/posthog/clickhouse/hcl/sql/dev/logs.sql
index ff0c7b218990..7ec74d1edffc 100644
--- a/posthog/clickhouse/hcl/sql/dev/logs.sql
+++ b/posthog/clickhouse/hcl/sql/dev/logs.sql
@@ -457,6 +457,7 @@ CREATE TABLE posthog.metrics2 (
INDEX idx_trace_id_bf trace_id TYPE bloom_filter(0.01) GRANULARITY 1,
INDEX idx_resource_fingerprint resource_fingerprint TYPE bloom_filter(0.01) GRANULARITY 1,
INDEX idx_observed_minmax observed_timestamp TYPE minmax GRANULARITY 1,
+ INDEX idx_timestamp_minmax timestamp TYPE minmax GRANULARITY 1,
PROJECTION projection_series_activity (SELECT
team_id,
service_name,
diff --git a/posthog/clickhouse/hcl/sql/local-multi/logs.sql b/posthog/clickhouse/hcl/sql/local-multi/logs.sql
index e0cae83022bf..a1b34f67f1a9 100644
--- a/posthog/clickhouse/hcl/sql/local-multi/logs.sql
+++ b/posthog/clickhouse/hcl/sql/local-multi/logs.sql
@@ -570,6 +570,7 @@ CREATE TABLE posthog.metrics2 (
INDEX idx_trace_id_bf trace_id TYPE bloom_filter(0.01) GRANULARITY 1,
INDEX idx_resource_fingerprint resource_fingerprint TYPE bloom_filter(0.01) GRANULARITY 1,
INDEX idx_observed_minmax observed_timestamp TYPE minmax GRANULARITY 1,
+ INDEX idx_timestamp_minmax timestamp TYPE minmax GRANULARITY 1,
PROJECTION projection_series_activity (SELECT
team_id,
service_name,
diff --git a/posthog/clickhouse/hcl/sql/local-single/all.sql b/posthog/clickhouse/hcl/sql/local-single/all.sql
index 0d3d9781c034..91673c24c31d 100644
--- a/posthog/clickhouse/hcl/sql/local-single/all.sql
+++ b/posthog/clickhouse/hcl/sql/local-single/all.sql
@@ -1461,6 +1461,7 @@ CREATE TABLE posthog.metrics2 (
INDEX idx_trace_id_bf trace_id TYPE bloom_filter(0.01) GRANULARITY 1,
INDEX idx_resource_fingerprint resource_fingerprint TYPE bloom_filter(0.01) GRANULARITY 1,
INDEX idx_observed_minmax observed_timestamp TYPE minmax GRANULARITY 1,
+ INDEX idx_timestamp_minmax timestamp TYPE minmax GRANULARITY 1,
PROJECTION projection_series_activity (SELECT
team_id,
service_name,
diff --git a/posthog/clickhouse/hcl/sql/prod-eu/logs.sql b/posthog/clickhouse/hcl/sql/prod-eu/logs.sql
index 663c9b82f195..1a44326bdac5 100644
--- a/posthog/clickhouse/hcl/sql/prod-eu/logs.sql
+++ b/posthog/clickhouse/hcl/sql/prod-eu/logs.sql
@@ -502,6 +502,7 @@ CREATE TABLE posthog.metrics2 (
INDEX idx_trace_id_bf trace_id TYPE bloom_filter(0.01) GRANULARITY 1,
INDEX idx_resource_fingerprint resource_fingerprint TYPE bloom_filter(0.01) GRANULARITY 1,
INDEX idx_observed_minmax observed_timestamp TYPE minmax GRANULARITY 1,
+ INDEX idx_timestamp_minmax timestamp TYPE minmax GRANULARITY 1,
PROJECTION projection_series_activity (SELECT
team_id,
service_name,
diff --git a/posthog/clickhouse/hcl/sql/prod-us/logs.sql b/posthog/clickhouse/hcl/sql/prod-us/logs.sql
index 05ccfe3c80ed..b886a70d0a91 100644
--- a/posthog/clickhouse/hcl/sql/prod-us/logs.sql
+++ b/posthog/clickhouse/hcl/sql/prod-us/logs.sql
@@ -502,6 +502,7 @@ CREATE TABLE posthog.metrics2 (
INDEX idx_trace_id_bf trace_id TYPE bloom_filter(0.01) GRANULARITY 1,
INDEX idx_resource_fingerprint resource_fingerprint TYPE bloom_filter(0.01) GRANULARITY 1,
INDEX idx_observed_minmax observed_timestamp TYPE minmax GRANULARITY 1,
+ INDEX idx_timestamp_minmax timestamp TYPE minmax GRANULARITY 1,
PROJECTION projection_series_activity (SELECT
team_id,
service_name,