[galaxyproject/galaxy] 93d5c5: Optimize count query in grids (part 1).
Branch: refs/heads/release_18.01 Home: https://github.com/galaxyproject/galaxy Commit: 93d5c54946e992112841df3461512bbeb6f5c7e9 https://github.com/galaxyproject/galaxy/commit/93d5c54946e992112841df3461512... Author: John Chilton <jmchilton@gmail.com> Date: 2018-02-21 (Wed, 21 Feb 2018) Changed paths: M lib/galaxy/web/framework/helpers/grids.py Log Message: ----------- Optimize count query in grids (part 1). Many grid operations execute a complex query twice - once to produce the total number of rows and once to iterate through the selected parts of the data. This can be more optimal in many ways - this starts us down the path to addressing that by doing two things. The first thing it does is eliminates the query all together if paging is enabled but the user has opted to see "all" the rows. There was never a reason to execute the query in that case I don't think. The second thing it does is move the calculation of the count query until after the data has been generated - this isn't more optimal by itself but it allows us to potentially calculate the count as part of the main query. I've implemented this in a broken way @ https://github.com/galaxyproject/galaxy/commit/ea404721585b5f78da1b91e57e31b... but I realized it was too broad an approach and doesn't work if certain kinds of joins are used in the initial query - but a more targetted approach on a per-grid basis could work I think and moving this code after allow us to potentially do that more easily in subsequent commits. Additionally I added a note - that I think it would be best to just return None as the number of pages and issue a second query to the same endpoint with the same arguments but with count_only=true added as a query request parameter so we can render the main grid faster and then render the paging elements after the second query finishes. This would feel more responsive I think. Commit: 50cd159d4c212a36b8d3861295125ef055a296d9 https://github.com/galaxyproject/galaxy/commit/50cd159d4c212a36b8d3861295125... Author: Martin Cech <marten@bx.psu.edu> Date: 2018-02-27 (Tue, 27 Feb 2018) Changed paths: M lib/galaxy/web/framework/helpers/grids.py Log Message: ----------- Merge pull request #5574 from jmchilton/optimize_count_query_1 [18.01] Optimize count query in grids (Part 1). Compare: https://github.com/galaxyproject/galaxy/compare/d8585f6a6f87...50cd159d4c21
participants (1)
-
GitHub