Skip to content

Commit ebaf307

Browse files
chain312arm4b
andauthored
Add a federated index to resolve mongo slow queries (#5818)
* Add a new cron function * Add a new cron function * set the milestone * Adding a union index speeds * Update execution_queue.py * Update execution_queue.py * Update execution_queue.py * Update CHANGELOG.rst * Update execution_queue.py * Update st2common/st2common/constants/triggers.py * Update CHANGELOG.rst * Reformat with black Co-authored-by: Eugen C <1533818+armab@users.noreply.github.com>
1 parent a71b41d commit ebaf307

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Added
1616
#5778 #5789 #5817 #5795 #5830 #5833 #5834 #5841 #5840 #5838 #5842 #5837 #5849 #5850
1717
Contributed by @cognifloyd
1818

19+
* Added a joint index to solve the problem of slow mongo queries for scheduled executions. #5805
20+
1921

2022
3.8.0 - November 18, 2022
2123
-------------------------

st2common/st2common/models/db/execution_queue.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ class ActionExecutionSchedulingQueueItemDB(
7777
{"fields": ["liveaction_id"], "name": "lv_ac_id"},
7878
{"fields": ["original_start_timestamp"], "name": "orig_s_ts"},
7979
{"fields": ["scheduled_start_timestamp"], "name": "schd_s_ts"},
80+
# Adding a union index speeds up the query action_execution_scheduling_queue_item_d_b
81+
{
82+
"fields": ["scheduled_start_timestamp", "original_start_timestamp"],
83+
"name": "schd_orig_s_ts",
84+
},
8085
]
8186
}
8287

0 commit comments

Comments
 (0)