Skip to content

Commit ab9276b

Browse files
authored
feat: modify workspace_agent_stats index (#10073)
1 parent 3044091 commit ab9276b

3 files changed

+11
-1
lines changed

coderd/database/dump.sql

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
DROP INDEX workspace_agent_stats_template_id_created_at_user_id_idx;
2+
3+
CREATE INDEX workspace_agent_stats_template_id_created_at_user_id_idx ON workspace_agent_stats USING btree (template_id, created_at DESC, user_id) WHERE connection_count > 0;
4+
5+
COMMENT ON INDEX workspace_agent_stats_template_id_created_at_user_id_idx IS 'Support index for template insights endpoint to build interval reports faster.';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
DROP INDEX workspace_agent_stats_template_id_created_at_user_id_idx;
2+
3+
CREATE INDEX workspace_agent_stats_template_id_created_at_user_id_idx ON workspace_agent_stats (template_id, created_at, user_id) INCLUDE (session_count_vscode, session_count_jetbrains, session_count_reconnecting_pty, session_count_ssh, connection_median_latency_ms) WHERE connection_count > 0;
4+
5+
COMMENT ON INDEX workspace_agent_stats_template_id_created_at_user_id_idx IS 'Support index for template insights endpoint to build interval reports faster.';

0 commit comments

Comments
 (0)