-
Notifications
You must be signed in to change notification settings - Fork 119
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
Improve performance of mysql generator #309
Improve performance of mysql generator #309
Conversation
95f3c43
to
a3ce5eb
Compare
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #309 +/- ##
==========================================
+ Coverage 90.54% 90.55% +0.01%
==========================================
Files 124 124
Lines 7307 7288 -19
==========================================
- Hits 6616 6600 -16
+ Misses 530 528 -2
+ Partials 161 160 -1 ☔ View full report in Codecov by Sentry. |
Hi @jupp0r, Whats your setup? Are you running MySQL 5.7 on a docker? Mac silicon?
One minut or one second? |
One second. This is on an Apple M1 Max Macbook Pro running Percona 5.7.35-38 natively (the x64 version though, ie emulated using Rosetta. It's generally pretty performant compared to production on dev machines though). Each of the per-table queries was taking more than 30s for some reason. The single compound query is much faster. Might be an old mysql bug (missing index on the meta schema? lock contention? no idea why it was so slow). MySQL was saturating one core while doing those queries. |
a3ce5eb
to
11a4ffe
Compare
This change improves performance for generating mysql models for databases with large number of tables. In my local testing for a database with about 1000 tables and 140k columns, generation time was reduced from about 1h to less than one second.
11a4ffe
to
bffec36
Compare
Looks good. 👍 |
This change improves performance for generating mysql models for databases with large number of tables by eliminating an N+1 query. In my local testing for a database with about 1000 tables and 140k columns, generation time was reduced from about 1h to less than one second.
This is on MySQL 5.7 (I know....), I think those original queries were faster on MySQL 8. The change is sensible in any case.