feat: curioweb: Improve task_history indexes (#11911)

This commit is contained in:
Łukasz Magiera 2024-04-24 21:46:04 +02:00
parent 1b6bffd339
commit c2dd67403b
2 changed files with 10 additions and 0 deletions

View File

@ -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);

View File

@ -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);