)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"71deb86a4997cf6f4257f976080c15d313bb6e44","unresolved":false,"context_lines":[{"line_number":11,"context_line":"or lower than idx_max. This is expected to increase queries speed"},{"line_number":12,"context_line":"compared to using the offset argument when it is possible to do"},{"line_number":13,"context_line":"so, since \"offset\" requires the database to sift through all results until"},{"line_number":14,"context_line":"the offset is reached."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I420d71d7c62dad6d118310525e97b4a546f05f99"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"dd5c29b0_cba3f6af","line":14,"updated":"2021-12-15 18:46:35.000000000","message":"At least with mysql, we may be splitting hairs here, and to be honest, I\u0027m not sure it\u0027s worth the complexity.\n\nLooking at the query plan in mysql for both the openstack and zuul tenants, mysql always says it\u0027s going to examine more rows if I add a minimum.  In the best case, it\u0027s about 2x the number of rows.  In some cases, it\u0027s much more.\n\nSince the query is already sorted descending, both the estimated and actual runtimes should be very close for page 1, then theoretically adding the minimum should gain an advantage as we go to more and more pages, as we don\u0027t need to gather as many items past our limit.  However, the database is already smart enough not to gather more items past our limit, so there really isn\u0027t an optimization to be made there.  They both run in a range of 0.00 to 0.02 seconds; effectively immeasurable under these conditions.\n\nAnd indeed, if I run the query with an offset of 20000, it takes 2.5 seconds with the minimum, and 1.86 seconds without -- confirming what the query planner estimates -- it\u0027s more work to add the minimum check.\n\nBut there are a lot of variables; is there a situation where you have confirmed better performance?","commit_id":"bc211ea7982d630e385bfdd1e9cffbaa3c8f3338"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"8065d128cd56abe40293c400db31a915a6fb28da","unresolved":false,"context_lines":[{"line_number":11,"context_line":"or lower than idx_max. This is expected to increase queries speed"},{"line_number":12,"context_line":"compared to using the offset argument when it is possible to do"},{"line_number":13,"context_line":"so, since \"offset\" requires the database to sift through all results until"},{"line_number":14,"context_line":"the offset is reached."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I420d71d7c62dad6d118310525e97b4a546f05f99"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"cde22c83_871ad979","line":14,"updated":"2021-12-15 19:03:45.000000000","message":"The commit message didn\u0027t mention that.  Using this without the offset does make a difference in query time.  Times remain about the same at page 1, but offset times increase with more pages and min/max times stay constant.\n\nI still have questions about how that will actually work (what happens when you\u0027re on page 2 and you hit back and there are more than 1 page worth of new builds on page 1?).  But we can address those later.","commit_id":"bc211ea7982d630e385bfdd1e9cffbaa3c8f3338"},{"author":{"_account_id":9311,"name":"Tristan Cacqueray","email":"tdecacqu@redhat.com","username":"tristanC"},"change_message_id":"919bba69278068706a48e398fd149656b20e61d5","unresolved":false,"context_lines":[{"line_number":11,"context_line":"or lower than idx_max. This is expected to increase queries speed"},{"line_number":12,"context_line":"compared to using the offset argument when it is possible to do"},{"line_number":13,"context_line":"so, since \"offset\" requires the database to sift through all results until"},{"line_number":14,"context_line":"the offset is reached."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I420d71d7c62dad6d118310525e97b4a546f05f99"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"21102220_a8233498","line":14,"in_reply_to":"dd5c29b0_cba3f6af","updated":"2021-12-15 18:51:33.000000000","message":"When crawling the builds, it can be error prone to rely on skip/limit when new builds are added between the queries, resulting in duplicated result. If I understand correctly, using the idx would ensure consistent result.","commit_id":"bc211ea7982d630e385bfdd1e9cffbaa3c8f3338"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":9311,"name":"Tristan Cacqueray","email":"tdecacqu@redhat.com","username":"tristanC"},"change_message_id":"2e4c9c67e662bad70df6384e4e2e4012096c1f73","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"94515577_2634e7f5","updated":"2021-12-16 13:02:48.000000000","message":"reverify parent timed out","commit_id":"bc211ea7982d630e385bfdd1e9cffbaa3c8f3338"}],"zuul/web/__init__.py":[{"author":{"_account_id":9311,"name":"Tristan Cacqueray","email":"tdecacqu@redhat.com","username":"tristanC"},"change_message_id":"d91769dd530d31313968f0e3aa701970327ec4d3","unresolved":true,"context_lines":[{"line_number":1308,"context_line":"            complete \u003d complete.lower() \u003d\u003d \u0027true\u0027"},{"line_number":1309,"context_line":""},{"line_number":1310,"context_line":"        try:"},{"line_number":1311,"context_line":"            _idx_max \u003d idx_max is not None and int(idx_max) or idx_max"},{"line_number":1312,"context_line":"            _idx_min \u003d idx_min is not None and int(idx_min) or idx_min"},{"line_number":1313,"context_line":"        except ValueError:"},{"line_number":1314,"context_line":"            raise cherrypy.HTTPError(400, \u0027idx_min, idx_max must be integers\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"d858cf69_cddecb45","line":1311,"updated":"2021-12-15 18:07:30.000000000","message":"nit: a `def int_or_none(param)` helper function could be useful here.","commit_id":"bc211ea7982d630e385bfdd1e9cffbaa3c8f3338"}]}
