-
Notifications
You must be signed in to change notification settings - Fork 14k
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
fix(sqllab): Inefficient SqlaTable query (#24343) #24344
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24344 +/- ##
=======================================
Coverage 69.09% 69.09%
=======================================
Files 1903 1903
Lines 74608 74610 +2
Branches 8107 8107
=======================================
+ Hits 51550 51552 +2
Misses 20947 20947
Partials 2111 2111
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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, big thanks for this perf improvement!
Edit: Never mind, I read this too hastily; @giftig , can you apply the same fix to this code to ensure this doesn't break again when #24342 is merged? superset/superset/databases/commands/tables.py Lines 74 to 82 in 0e3f1f6
|
Use a combination of lazyload and load_only to ensure sqlalchemy doesn't eagerly join to additional tables, which was happening in a very inefficient way for a large number of tables and resulting in this endpoint never returning (in addition to high db load)
Use a combination of lazyload and load_only to ensure sqlalchemy doesn't eagerly join to additional tables, which was happening in a very inefficient way for a large number of tables and resulting in this endpoint never returning (in addition to high db load)
SUMMARY
Makes the lookup for
extra
for tables listed by schema much more efficient, especially when there is a large number of tables present.TESTING INSTRUCTIONS
More info on the associated issue: #24343
ADDITIONAL INFORMATION