-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
feat(database): Add user_id and dttm composite index to Log model. #19532
Conversation
Codecov Report
@@ Coverage Diff @@
## master #19532 +/- ##
===========================================
- Coverage 66.60% 53.88% -12.72%
===========================================
Files 1678 1678
Lines 64246 64246
Branches 6539 6539
===========================================
- Hits 42788 34616 -8172
- Misses 19763 27935 +8172
Partials 1695 1695
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
LGTM. Although I do wonder what's the implication of having this index on the write performance for logs.
In the long run, we should probably design two separate tables for different types of logs---one for online display such as auditing logs and recent activities, another for offline analysis such as page loading performance.
…pache#19532) * feat: Added user_id and dttm composite index to Log model. * fix: Refactored migration to a general view. * fix: Changed down revision. * fix: Formatted with black. * fix: Removed odd Index import.
SUMMARY
When opening welcome page (
/superset/welcome/
) it took between 10 and 20 seconds to show first results. This is because of/superset/recent_activity
endpoint and query againstlogs
table inside it. To speed up this query I suggest to add composite index fromuser_id
anddttm
to this table.ADDITIONAL INFORMATION