)]}'
{"ceilometer/storage/impl_sqlalchemy.py":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"fe219d6dbbc89c3245ac55ef425164d00d9b2c02","unresolved":false,"context_lines":[{"line_number":529,"context_line":"            if value:"},{"line_number":530,"context_line":"                sample_subq \u003d sample_subq.filter(column \u003d\u003d value)"},{"line_number":531,"context_line":"        sample_subq \u003d sample_subq.group_by("},{"line_number":532,"context_line":"            models.Sample.meter_id, models.Sample.resource_id)"},{"line_number":533,"context_line":"        sample_subq \u003d sample_subq.subquery()"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"        # SELECT sample.* FROM sample INNER JOIN"}],"source_content_type":"text/x-python","patch_set":2,"id":"7adec928_d58e4978","line":532,"updated":"2014-05-20 12:37:45.000000000","message":"this appears to be just applying filter to subquery... it seems cleaner to use _apply_filter() on subquery and remove it from end query.\n\n(i tried both and didn\u0027t really see a performance gain initially but i didn\u0027t try your use case)","commit_id":"a46947b9847c320ba46e571e561fcf8d649d3928"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"88dd7f75d4bb9411b0feb2038f9b35a5be22f36e","unresolved":false,"context_lines":[{"line_number":529,"context_line":"            if value:"},{"line_number":530,"context_line":"                sample_subq \u003d sample_subq.filter(column \u003d\u003d value)"},{"line_number":531,"context_line":"        sample_subq \u003d sample_subq.group_by("},{"line_number":532,"context_line":"            models.Sample.meter_id, models.Sample.resource_id)"},{"line_number":533,"context_line":"        sample_subq \u003d sample_subq.subquery()"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"        # SELECT sample.* FROM sample INNER JOIN"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_90a2faab","line":532,"in_reply_to":"7adec928_b579bd30","updated":"2014-07-29 12:44:38.000000000","message":"hi Koert, i apologise for not following up on this. but was the reason you filter on just resource and project just because the tests passed or was there another reasoning behind it?","commit_id":"a46947b9847c320ba46e571e561fcf8d649d3928"},{"author":{"_account_id":5619,"name":"Koert van der Veer","email":"koert@cloudvps.com","username":"kvdveer"},"change_message_id":"6e449f0ef8d0db8504e4899be65addc7a51f44a1","unresolved":false,"context_lines":[{"line_number":529,"context_line":"            if value:"},{"line_number":530,"context_line":"                sample_subq \u003d sample_subq.filter(column \u003d\u003d value)"},{"line_number":531,"context_line":"        sample_subq \u003d sample_subq.group_by("},{"line_number":532,"context_line":"            models.Sample.meter_id, models.Sample.resource_id)"},{"line_number":533,"context_line":"        sample_subq \u003d sample_subq.subquery()"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"        # SELECT sample.* FROM sample INNER JOIN"}],"source_content_type":"text/x-python","patch_set":2,"id":"7adec928_b579bd30","line":532,"in_reply_to":"7adec928_d58e4978","updated":"2014-05-20 12:50:29.000000000","message":"My usecase is MySQL with a large number of samples. In that scenario, the unfiltered subquery returns a very high number of samples, which will later be evicted by the join. For some reason, MySQL doesn\u0027t properly optimize across the subquery boundary. \n\nMy initial approach was to use _apply_filter, but one of the unit tests fails, as the latest sample might have been under a different user. I can\u0027t tell if the code is wrong, or the scenario, so I just copied it all. In the end it all needs to go to make_query_from_filter.","commit_id":"a46947b9847c320ba46e571e561fcf8d649d3928"}]}
