mirror of https://github.com/coder/coder.git
feat: modify `workspace_agent_stats` index (#10073)
This commit is contained in:
parent
30440915bc
commit
ab9276bd08
|
@ -1351,7 +1351,7 @@ CREATE UNIQUE INDEX users_username_lower_idx ON users USING btree (lower(usernam
|
|||
|
||||
CREATE INDEX workspace_agent_startup_logs_id_agent_id_idx ON workspace_agent_logs USING btree (agent_id, id);
|
||||
|
||||
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);
|
||||
CREATE INDEX workspace_agent_stats_template_id_created_at_user_id_idx ON workspace_agent_stats USING btree (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);
|
||||
|
||||
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,0 +1,5 @@
|
|||
DROP INDEX workspace_agent_stats_template_id_created_at_user_id_idx;
|
||||
|
||||
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;
|
||||
|
||||
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,0 +1,5 @@
|
|||
DROP INDEX workspace_agent_stats_template_id_created_at_user_id_idx;
|
||||
|
||||
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;
|
||||
|
||||
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.';
|
Loading…
Reference in New Issue