Skip to content

Commit

Permalink
added a projection to make things faster
Browse files Browse the repository at this point in the history
  • Loading branch information
fuziontech committed Nov 17, 2023
1 parent 9688b96 commit 1314db2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions posthog/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,7 @@ def clickhouse_lag():
for table in CLICKHOUSE_TABLES:
try:
QUERY = """SELECT max(_timestamp) observed_ts, now() now_ts, now() - max(_timestamp) as lag
FROM {table}
WHERE timestamp >= now() - toIntervalDay(3);"""
FROM {table}"""
query = QUERY.format(table=table)
lag = sync_execute(query)[0][2]
statsd.gauge(
Expand Down

0 comments on commit 1314db2

Please sign in to comment.