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 6730949
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/harmony/harmonydb/sql/20240317-web-summary-index.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* Used for webui clusterMachineSummary */
CREATE INDEX harmony_task_history_work_index
ON harmony_task_history (completed_by_host_and_port ASC, name ASC, result ASC, work_end DESC);
-- 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);

/* Used for webui actorSummary sp wins */
CREATE INDEX mining_tasks_won_sp_id_base_compute_time_index
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 6730949

Please sign in to comment.