mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
feat: add index to workspace_agent_stats
(#10009)
This commit is contained in:
4
coderd/database/dump.sql
generated
4
coderd/database/dump.sql
generated
@ -1321,6 +1321,10 @@ 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);
|
||||
|
||||
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.';
|
||||
|
||||
CREATE INDEX workspace_agents_auth_token_idx ON workspace_agents USING btree (auth_token);
|
||||
|
||||
CREATE INDEX workspace_agents_resource_id_idx ON workspace_agents USING btree (resource_id);
|
||||
|
@ -0,0 +1 @@
|
||||
DROP INDEX workspace_agent_stats_template_id_created_at_user_id_idx;
|
@ -0,0 +1,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;
|
||||
|
||||
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.';
|
Reference in New Issue
Block a user