Skip to content

Commit

Permalink
Use v3 table for cache invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
alpinskiy committed Nov 26, 2024
1 parent 3b59a7e commit 4bc6445
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ func (h *Handler) invalidateCache(ctx context.Context, from int64, seen map[cach

queryBody, err := util.BindQuery(fmt.Sprintf(`
SELECT
toInt64(time) AS time, toInt64(key1) AS key1
toInt64(time) AS time, toInt64(tag1) AS key1
FROM
%s
WHERE
Expand All @@ -760,7 +760,7 @@ LIMIT
?
SETTINGS
optimize_aggregation_in_order = 1
`, _1sTableSH2), format.BuiltinMetricIDContributorsLog, from, cacheInvalidateMaxRows)
`, _1sTableSH3), format.BuiltinMetricIDContributorsLog, from, cacheInvalidateMaxRows)
if err != nil {
log.Printf("[error] cache invalidation log query failed: %v", err)
return from, seen
Expand Down
1 change: 1 addition & 0 deletions internal/api/lod.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
_1sTableSH2 = "statshouse_value_1s_dist"
_1mTableSH2 = "statshouse_value_1m_dist"
_1hTableSH2 = "statshouse_value_1h_dist"
_1sTableSH3 = "statshouse_v3_1s_dist"
)

var (
Expand Down

0 comments on commit 4bc6445

Please sign in to comment.