-
Notifications
You must be signed in to change notification settings - Fork 210
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
Optimizations for gallery page view #1297
Comments
Nice, a lot is selection from maps -- which we do call twice. I wonder if we simply need some more indexing on the maps table? |
I mean, pagination via the Indeed we only index maps on Line 78 in 2c5704c
The queries we are seeing take 1.2 seconds each are: SELECT maps.*, count(maps.id) as image_count FROM `maps` INNER JOIN `warpables` ON `warpables`.`map_id` = `maps`.`id` GROUP BY warpables.map_id ORDER BY image_count DESC and SELECT maps.*, count(maps.id) as image_count FROM `maps` INNER JOIN `warpables` ON `warpables`.`map_id` = `maps`.`id` WHERE `maps`.`archived` = ? AND `maps`.`password` = ? GROUP BY maps.id, warpables.map_id ORDER BY updated_at DESC, image_count DESC LIMIT ? OFFSET ? |
Ah, if we are joining Lines 92 to 97 in 2c5704c
|
So, we may be able to filter out any warpables which aren't the latest version, here: https://github.com/paper-trail-gem/paper_trail#3-working-with-versions This uses a |
Updating that we actually aren't saving all that many versions of images, we've found. But we could try for a narrower query on line 93, anyways? I mean, we only use the count and the first one (for the lead image). |
...which is experiencing slow load times -- possibly connected to #1167...?
mapknitter/app/controllers/front_ui_controller.rb
Lines 64 to 73 in 5022129
Looking in skylight here: https://oss.skylight.io/app/applications/ArYnJAb3VUC9/1589300520/6h/endpoints
The text was updated successfully, but these errors were encountered: