Skip to content

Commit

Permalink
feat: curioweb: Improve task_history indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Apr 20, 2024
1 parent 1a789d3 commit 14a3a10
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/harmony/harmonydb/sql/20240317-web-summary-index.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Used for webui clusterMachineSummary */
-- NOTE: This index is changed in 20240420-web-task-indexes.sql
CREATE INDEX harmony_task_history_work_index
ON harmony_task_history (completed_by_host_and_port ASC, name ASC, result ASC, work_end DESC);

Expand Down
9 changes: 9 additions & 0 deletions lib/harmony/harmonydb/sql/20240420-web-task-indexes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DROP INDEX harmony_task_history_work_index;

/*
This structure improves clusterMachineSummary query better than the old version,
while at the same time also being usable by clusterTaskHistorySummary (which wasn't
the case with the old index).
*/
create index harmony_task_history_work_index
on harmony_task_history (work_end desc, completed_by_host_and_port asc, name asc, result asc);

0 comments on commit 14a3a10

Please sign in to comment.