New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #10879 - improved reports widget performance #2478
Conversation
Our patch for the widget is basically termorary until this is merged: wvanbergen/scoped_search#132 |
FYI, I intend to just close this PR once a new scoped_search is released, we'll simply inherit the bug fix from your work there. |
Thanks @lzap! |
Belatedly, I notice that you're including a DB migration here to make the column non-null, reopening. |
@@ -59,8 +59,8 @@ def searchable_links(name, search, counter) | |||
end | |||
|
|||
def latest_events | |||
# 6 reports + header fits the events box nicely... | |||
Report.authorized(:view_reports).my_reports.interesting.search_for('reported > "7 days ago"').limit(6).includes(:host) | |||
# scoped_search generates unoptimized query until this is fixed: https://github.com/wvanbergen/scoped_search/pull/132 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file's changes can be reverted now.
Sure, rebased! |
and made created_at column non-NULL to prevent from other expensive queries
with "NULLS FIRST" or "NULLS LAST". This is being added by scoped_search.