Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita69fc65

Browse files
authored
chore(coderd/database): reduce dbpurge load with smaller batches of agent stats (#13049)
1 parent2f7f9d0 commita69fc65

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

‎coderd/database/queries.sql.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/queries/workspaceagentstats.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ WHERE
8787
template_usage_stats
8888
)
8989
AND created_at< (
90-
-- Delete at most in batches of3 days (witha batch size of 3 days, we
91-
-- can clear out the previous 6 months of data in ~60 iterations) whilst
92-
-- keeping the DB load relatively low.
90+
-- Delete at most in batches of4 hours (withthis batch size, assuming
91+
--1 iteration / 10 minutes, wecan clear out the previous 6 months of
92+
--data in 7.5 days) whilstkeeping the DB load low.
9393
SELECT
94-
COALESCE(MIN(created_at)+'3 days'::interval, NOW())
94+
COALESCE(MIN(created_at)+'4 hours'::interval, NOW())
9595
FROM
9696
workspace_agent_stats
9797
);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp