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 slow/unindexed queries #4081
Conversation
Fixes wallabag#4080 Signed-off-by: Olivier Mehani <shtrom@ssji.net>
Fixes wallabag#4079 Signed-off-by: Olivier Mehani <shtrom@ssji.net>
a593e9c
to
f5527fc
Compare
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.
That's a start.
Migration in SQLite are quite complex (but well handled by doctrine) but yes, when changing a column type in SQLite require some big query. I'll try to help here
If you like, I have slow query logging active on the server I run Wallabag on. I can check the MySQL log and see if anything from Wallabag wound up in there. |
Yeah, my guess is that the migration need to move away from raw SQL, and use Doctrine instead, but I'm not familiar enough with it just yet : |
Yeah, same; that's how I keep finding slow queries in a few projects I use. Mainly because my server is so underpowered 😬 |
I've fixed migrations. |
Cool. Yeah SQLite3 is messy. |
Damn, hold on, I hit a new slow query now. |
Same fix as tagged:
I'll add that to the PR. |
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
Same for |
wallabag will be really faster after that 🚀 |
@virtadpt did you find some other slow queries? |
I have not. |
Yeah. tbh, it's an issue I have with ~2k entries, but mainly because my server is so small. One thing I wonder, though, is how wallabag.it and other shared instances with many users handle this. |
You can tell MySQL to also log queries that are not using indices. This makes the slow_log substantially noisier, but this might help find problematic queries before they are actually slow. |
I should try to have a look at those log on wallabag.it |
Checking the
That one is easy to fix with an index on the CREATE INDEX tag_label ON wallabag_tag (label (255)); Then I found that one:
Which is also easy to fix: CREATE INDEX config_rss_token ON wallabag_config (rss_token (255)); |
Fixes #4079, #4080
@j0k3r I updated the entities and generated the migrations with
doctrine:migrations:diff
, but I did struggle and have to go back and forth fiddling with the files (for some reason the firstdiff
would generate a whole lot of unrelated migrations).Now, the tests fail on the change of the the
language
column, which I suspect is due to SQLite3 being used for the test, and not supporting this sort of change. I'm not sure how to proceed with that particular migration (save from dumping/restoring all the data, but it feels quite overkill).