feat: add index to workspace_agent_stats (#10009)

This commit is contained in:
Marcin Tojek
2023-10-03 11:13:44 +00:00
committed by GitHub
parent cc2772c646
commit cb60409a8c
3 changed files with 8 additions and 0 deletions
@@ -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.';