)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"3287c15a93a5345efe9c364d8a3150f340c68b70","unresolved":true,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2022-11-23 12:36:04 +0100"},{"line_number":4,"context_line":"Commit:     guest \u003colivier.chaze@infomaniak.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2022-11-29 08:19:46 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Optimizing SQL queries that filter on a time range."},{"line_number":8,"context_line":"Narrowing data to process by filtering more on frame_model.begin"},{"line_number":9,"context_line":"using `BETWEEN` statement which can also use indexes."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I8acbc8946d9e001419f7bf5064fcebe0a0ae907a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"89d1ab59_308aa745","line":9,"range":{"start_line":6,"start_character":0,"end_line":9,"end_character":53},"updated":"2022-11-29 15:35:14.000000000","message":"Hello Olivier,\n\nPlease follow these guidelines when you write commit messages: https://wiki.openstack.org/wiki/GitCommitMessages#Summary_of_Git_commit_message_structure\n\nThanks.","commit_id":"eb09ea4b64b3c0fe143e2bea17cb4baba6e649f9"},{"author":{"_account_id":29422,"name":"Olivier Chaze","display_name":"Olivier Chaze","email":"olivier.chaze@infomaniak.com","username":"o.chaze"},"change_message_id":"6557d5e761fe410f37221074b22c52f9438b341a","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2022-11-23 12:36:04 +0100"},{"line_number":4,"context_line":"Commit:     guest \u003colivier.chaze@infomaniak.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2022-11-29 08:19:46 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Optimizing SQL queries that filter on a time range."},{"line_number":8,"context_line":"Narrowing data to process by filtering more on frame_model.begin"},{"line_number":9,"context_line":"using `BETWEEN` statement which can also use indexes."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I8acbc8946d9e001419f7bf5064fcebe0a0ae907a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ddfed51e_362fbad3","line":9,"range":{"start_line":6,"start_character":0,"end_line":9,"end_character":53},"in_reply_to":"89d1ab59_308aa745","updated":"2022-12-01 09:16:33.000000000","message":"Hope it is ok now :-)","commit_id":"eb09ea4b64b3c0fe143e2bea17cb4baba6e649f9"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"91c65e05c53873c372f1b0a391574b3ee70058a0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"8352082f_be0ce063","updated":"2022-11-28 10:59:44.000000000","message":"Thanks Oliver for your patch. Can you explain a little bit more the optimization you are making here?","commit_id":"63ad92623fd3e13c19a5ab382d8a55e4b32ec970"},{"author":{"_account_id":29422,"name":"Olivier Chaze","display_name":"Olivier Chaze","email":"olivier.chaze@infomaniak.com","username":"o.chaze"},"change_message_id":"f7f742482f65c81302cb15cc494584a096a05c3a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"c37ef7a6_5c7d0d59","in_reply_to":"8352082f_be0ce063","updated":"2022-11-28 13:52:46.000000000","message":"Hi Rafael,\n\nI want to optimize SQL queries using indexes, link to https://review.opendev.org/c/openstack/cloudkitty/+/865435\n\n```\nMariaDB [cloudkittydb]\u003e EXPLAIN SELECT sum(rated_data_frames.rate) AS rate FROM rated_data_frames WHERE rated_data_frames.begin \u003e\u003d \u00272022-10-17T05:00:00+00:00\u0027 AND rated_data_frames.end  \u003c\u003d \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.res_type !\u003d \u0027_NO_DATA_\u0027;\n+------+-------------+-------------------+------+-----------------------------------------------------------+------+---------+------+----------+-------------+\n| id   | select_type | table             | type | possible_keys                                             | key  | key_len | ref  | rows     | Extra       |\n+------+-------------+-------------------+------+-----------------------------------------------------------+------+---------+------+----------+-------------+\n|    1 | SIMPLE      | rated_data_frames | ALL  | idx_rated_data_frames_date,idx_rated_data_frames_res_type | NULL | NULL    | NULL | 35070682 | Using where |\n+------+-------------+-------------------+------+-----------------------------------------------------------+------+---------+------+----------+-------------+\n1 row in set (0.001 sec)\n```\n\n```\nMariaDB [cloudkittydb]\u003e EXPLAIN SELECT sum(rated_data_frames.rate) AS rate FROM rated_data_frames WHERE rated_data_frames.begin BETWEEN \u00272022-10-17T05:00:00+00:00\u0027 AND \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.end  \u003c\u003d \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.res_type !\u003d \u0027_NO_DATA_\u0027;\n+------+-------------+-------------------+-------+-----------------------------------------------------------+----------------------------+---------+------+------+------------------------------------+\n| id   | select_type | table             | type  | possible_keys                                             | key                        | key_len | ref  | rows | Extra                              |\n+------+-------------+-------------------+-------+-----------------------------------------------------------+----------------------------+---------+------+------+------------------------------------+\n|    1 | SIMPLE      | rated_data_frames | range | idx_rated_data_frames_date,idx_rated_data_frames_res_type | idx_rated_data_frames_date | 5       | NULL | 5721 | Using index condition; Using where |\n+------+-------------+-------------------+-------+-----------------------------------------------------------+----------------------------+---------+------+------+------------------------------------+\n```\n\n```\nMariaDB [cloudkittydb]\u003e SELECT sum(rated_data_frames.rate) AS rate FROM rated_data_frames WHERE rated_data_frames.begin \u003e\u003d \u00272022-10-17T05:00:00+00:00\u0027 AND rated_data_frames.end  \u003c\u003d \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.res_type !\u003d \u0027_NO_DATA_\u0027;\n+--------------------+\n| rate               |\n+--------------------+\n| 26.600149593914693 |\n+--------------------+\n1 row in set, 2 warnings (17.905 sec)\n\nMariaDB [cloudkittydb]\u003e SELECT sum(rated_data_frames.rate) AS rate FROM rated_data_frames WHERE rated_data_frames.begin BETWEEN \u00272022-10-17T05:00:00+00:00\u0027 AND \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.end  \u003c\u003d \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.res_type !\u003d \u0027_NO_DATA_\u0027;\n\n+--------------------+\n| rate               |\n+--------------------+\n| 26.600149593914693 |\n+--------------------+\n1 row in set, 3 warnings (0.027 sec)\n```","commit_id":"63ad92623fd3e13c19a5ab382d8a55e4b32ec970"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"933eb8c20e8092bca078c8ca43b7448133e5bb31","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"841d2958_c7825930","updated":"2022-11-29 11:00:55.000000000","message":"Thanks for the improvement in the commit message. Can you also add a release notes here?","commit_id":"eb09ea4b64b3c0fe143e2bea17cb4baba6e649f9"},{"author":{"_account_id":25277,"name":"Mariusz Karpiarz","email":"mariusz.karpiarz@codethink.co.uk","username":"mkarpiarz"},"change_message_id":"81ac173668c368c31ef71e47446f9ad8dd5ea83f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"fa8c6a32_1406e8f2","updated":"2022-12-12 13:10:38.000000000","message":"I confirm this change is working in my test environment but this is too small to test anything at scale.\n\nI\u0027ll let Rafael approve first and if he is happy, I\u0027ll change my +1 to +2.","commit_id":"581fe3f2e9f6af440e2e2215f573f4c326ca9738"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"1a6f431d82c4ce674cf8f81f36de33cd8c0cca5c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"e65e70c1_f1a995b8","in_reply_to":"fa8c6a32_1406e8f2","updated":"2023-01-26 20:34:38.000000000","message":"Can you reconsider this patch again?","commit_id":"581fe3f2e9f6af440e2e2215f573f4c326ca9738"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"a02ad1715dcbd4fa5e43cd683f4caeb9d5d1fad0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"f23a9918_1df4f4c5","updated":"2023-09-18 11:11:19.000000000","message":"recheck","commit_id":"10a9482a91ace68c081aa95ffb7fc394f688020c"}],"cloudkitty/storage/v1/sqlalchemy/__init__.py":[{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"91c65e05c53873c372f1b0a391574b3ee70058a0","unresolved":true,"context_lines":[{"line_number":114,"context_line":"                self.frame_model.res_type \u003d\u003d service)"},{"line_number":115,"context_line":"        q \u003d q.filter("},{"line_number":116,"context_line":"            self.frame_model.begin.between(begin, end),"},{"line_number":117,"context_line":"            self.frame_model.end \u003c\u003d end,"},{"line_number":118,"context_line":"            self.frame_model.res_type !\u003d \u0027_NO_DATA_\u0027)"},{"line_number":119,"context_line":"        if groupby:"},{"line_number":120,"context_line":"            q \u003d q.group_by(sqlalchemy.sql.text(groupby))"}],"source_content_type":"text/x-python","patch_set":2,"id":"6033bc91_b13dd47f","line":117,"range":{"start_line":117,"start_character":12,"end_line":117,"end_character":39},"updated":"2022-11-28 10:59:44.000000000","message":"You are maintaining the end filter here. Is that expected?","commit_id":"63ad92623fd3e13c19a5ab382d8a55e4b32ec970"},{"author":{"_account_id":29422,"name":"Olivier Chaze","display_name":"Olivier Chaze","email":"olivier.chaze@infomaniak.com","username":"o.chaze"},"change_message_id":"081d57e7ac473b1737468afa94345bb8be6b77a5","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                self.frame_model.res_type \u003d\u003d service)"},{"line_number":115,"context_line":"        q \u003d q.filter("},{"line_number":116,"context_line":"            self.frame_model.begin.between(begin, end),"},{"line_number":117,"context_line":"            self.frame_model.end \u003c\u003d end,"},{"line_number":118,"context_line":"            self.frame_model.res_type !\u003d \u0027_NO_DATA_\u0027)"},{"line_number":119,"context_line":"        if groupby:"},{"line_number":120,"context_line":"            q \u003d q.group_by(sqlalchemy.sql.text(groupby))"}],"source_content_type":"text/x-python","patch_set":2,"id":"cb02f8ea_abb94187","line":117,"range":{"start_line":117,"start_character":12,"end_line":117,"end_character":39},"in_reply_to":"1710145e_55d83da1","updated":"2022-11-28 14:17:21.000000000","message":"Yes but it requires new indexes being subimtted here : https://review.opendev.org/c/openstack/cloudkitty/+/865435\n\nOriginal query takes 1 min 38 seconds and parses 75 Millions rows.\nNew query takes only 0.028 seconds and parses only 39172 rows\n\nDetails below\n\n```\nMariaDB [cloudkittydb]\u003e SELECT sum(rated_data_frames.rate) AS rate FROM rated_data_frames WHERE rated_data_frames.begin \u003e\u003d \u00272022-10-17T05:00:00+00:00\u0027 AND rated_data_frames.end  \u003c\u003d \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.res_type !\u003d \u0027_NO_DATA_\u0027;\n+-------------------+\n| rate              |\n+-------------------+\n| 2968.960465135948 |\n+-------------------+\n1 row in set, 2 warnings (1 min 38.839 sec)\n\nMariaDB [cloudkittydb]\u003e EXPLAIN SELECT sum(rated_data_frames.rate) AS rate FROM rated_data_frames WHERE rated_data_frames.begin \u003e\u003d \u00272022-10-17T05:00:00+00:00\u0027 AND rated_data_frames.end  \u003c\u003d \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.res_type !\u003d \u0027_NO_DATA_\u0027;\n+------+-------------+-------------------+------+----------------------------+------+---------+------+----------+-------------+\n| id   | select_type | table             | type | possible_keys              | key  | key_len | ref  | rows     | Extra       |\n+------+-------------+-------------------+------+----------------------------+------+---------+------+----------+-------------+\n|    1 | SIMPLE      | rated_data_frames | ALL  | idx_rated_data_frames_date | NULL | NULL    | NULL | 75096101 | Using where |\n+------+-------------+-------------------+------+----------------------------+------+---------+------+----------+-------------+\n1 row in set (0.000 sec)\n\nMariaDB [cloudkittydb]\u003e SELECT sum(rated_data_frames.rate) AS rate FROM rated_data_frames WHERE rated_data_frames.begin BETWEEN \u00272022-10-17T05:00:00+00:00\u0027 AND \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.end  \u003c\u003d \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.res_type !\u003d \u0027_NO_DATA_\u0027;\n+-------------------+\n| rate              |\n+-------------------+\n| 2968.960465135948 |\n+-------------------+\n1 row in set, 3 warnings (0.026 sec)\n\nMariaDB [cloudkittydb]\u003e EXPLAIN SELECT sum(rated_data_frames.rate) AS rate FROM rated_data_frames WHERE rated_data_frames.begin BETWEEN \u00272022-10-17T05:00:00+00:00\u0027 AND \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.end  \u003c\u003d \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.res_type !\u003d \u0027_NO_DATA_\u0027;\n+------+-------------+-------------------+-------+----------------------------+----------------------------+---------+------+-------+------------------------------------+\n| id   | select_type | table             | type  | possible_keys              | key                        | key_len | ref  | rows  | Extra                              |\n+------+-------------+-------------------+-------+----------------------------+----------------------------+---------+------+-------+------------------------------------+\n|    1 | SIMPLE      | rated_data_frames | range | idx_rated_data_frames_date | idx_rated_data_frames_date | 5       | NULL | 39172 | Using index condition; Using where |\n+------+-------------+-------------------+-------+----------------------------+----------------------------+---------+------+-------+------------------------------------+\n1 row in set, 2 warnings (0.001 sec)\n```","commit_id":"63ad92623fd3e13c19a5ab382d8a55e4b32ec970"},{"author":{"_account_id":29422,"name":"Olivier Chaze","display_name":"Olivier Chaze","email":"olivier.chaze@infomaniak.com","username":"o.chaze"},"change_message_id":"f7f742482f65c81302cb15cc494584a096a05c3a","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                self.frame_model.res_type \u003d\u003d service)"},{"line_number":115,"context_line":"        q \u003d q.filter("},{"line_number":116,"context_line":"            self.frame_model.begin.between(begin, end),"},{"line_number":117,"context_line":"            self.frame_model.end \u003c\u003d end,"},{"line_number":118,"context_line":"            self.frame_model.res_type !\u003d \u0027_NO_DATA_\u0027)"},{"line_number":119,"context_line":"        if groupby:"},{"line_number":120,"context_line":"            q \u003d q.group_by(sqlalchemy.sql.text(groupby))"}],"source_content_type":"text/x-python","patch_set":2,"id":"8157703a_8cfb28b1","line":117,"range":{"start_line":117,"start_character":12,"end_line":117,"end_character":39},"in_reply_to":"6033bc91_b13dd47f","updated":"2022-11-28 13:52:46.000000000","message":"Yes, otherwise results would be different.\n\nOriginal query\n\n```\nMariaDB [cloudkittydb]\u003e SELECT sum(rated_data_frames.rate) AS rate FROM rated_data_frames WHERE rated_data_frames.begin \u003e\u003d \u00272022-10-17T05:00:00+00:00\u0027 AND rated_data_frames.end  \u003c\u003d \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.res_type !\u003d \u0027_NO_DATA_\u0027;\n+--------------------+\n| rate               |\n+--------------------+\n| 26.600149593914693 |\n+--------------------+\n```\n\nNew query\n\n```\nMariaDB [cloudkittydb]\u003e SELECT sum(rated_data_frames.rate) AS rate FROM rated_data_frames WHERE rated_data_frames.begin BETWEEN \u00272022-10-17T05:00:00+00:00\u0027 AND \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.end  \u003c\u003d \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.res_type !\u003d \u0027_NO_DATA_\u0027;\n+--------------------+\n| rate               |\n+--------------------+\n| 26.600149593914693 |\n+--------------------+\n```\n\nWithout end \u003c\u003d\n\n```\nMariaDB [cloudkittydb]\n\u003e SELECT sum(rated_data_frames.rate) AS rate FROM rated_data_frames WHERE rated_data_frames.begin BETWEEN \u00272022-10-17T05:00:00+00:00\u0027 AND \u00272022-10-17T06:00:00+00:00\u0027 AND rated_data_frames.res_type !\u003d \u0027_NO_DATA_\u0027;\n+-------------------+\n| rate              |\n+-------------------+\n| 34.56770233366516 |\n+-------------------+\n```","commit_id":"63ad92623fd3e13c19a5ab382d8a55e4b32ec970"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"2700782fa5f81c88373b816467521f33ec44da88","unresolved":true,"context_lines":[{"line_number":114,"context_line":"                self.frame_model.res_type \u003d\u003d service)"},{"line_number":115,"context_line":"        q \u003d q.filter("},{"line_number":116,"context_line":"            self.frame_model.begin.between(begin, end),"},{"line_number":117,"context_line":"            self.frame_model.end \u003c\u003d end,"},{"line_number":118,"context_line":"            self.frame_model.res_type !\u003d \u0027_NO_DATA_\u0027)"},{"line_number":119,"context_line":"        if groupby:"},{"line_number":120,"context_line":"            q \u003d q.group_by(sqlalchemy.sql.text(groupby))"}],"source_content_type":"text/x-python","patch_set":2,"id":"1710145e_55d83da1","line":117,"range":{"start_line":117,"start_character":12,"end_line":117,"end_character":39},"in_reply_to":"8157703a_8cfb28b1","updated":"2022-11-28 14:01:33.000000000","message":"I see, but is that optimized then? I mean, you are filtering using between and then using \u003c\u003d end again to maintain the result as it was before. Is this going to be faster?","commit_id":"63ad92623fd3e13c19a5ab382d8a55e4b32ec970"},{"author":{"_account_id":30695,"name":"Pedro Henrique Pereira Martins","email":"phpm13@gmail.com","username":"pedrohpmartins"},"change_message_id":"2ecaa4e377414ca7abc86752c79e1d9b9c77a0b1","unresolved":true,"context_lines":[{"line_number":137,"context_line":"            self.frame_model,"},{"line_number":138,"context_line":"            session)"},{"line_number":139,"context_line":"        q \u003d q.filter("},{"line_number":140,"context_line":"            self.frame_model.begin.between(begin, end),"},{"line_number":141,"context_line":"            self.frame_model.end \u003c\u003d end)"},{"line_number":142,"context_line":"        tenants \u003d q.distinct().values("},{"line_number":143,"context_line":"            self.frame_model.tenant_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"4e2644c2_c4e32c95","line":140,"updated":"2022-11-28 15:30:50.000000000","message":"Oh, Seeing the code, now I understood what you meant in optimizing the query. \n\nWhat you described in the Patch description does not comply with what you did, because simply changing a clause from x \u003e\u003d y and x \u003c\u003d z to x between y and z does not have any runtime impact.\n\nWhat you want to do (at least it was what I understood), is increasing the filtering for the begin clause, so as we are validating that the begin must be always \u003c than end, it means that if we have registries with the begin date greater than the required end date, these registries must be ignored before we apply the end date filtering, which means lots of less data to process for very past periods.\n\nSo I would only suggest you to update the Patch description to fit better with your optimization.","commit_id":"63ad92623fd3e13c19a5ab382d8a55e4b32ec970"},{"author":{"_account_id":29422,"name":"Olivier Chaze","display_name":"Olivier Chaze","email":"olivier.chaze@infomaniak.com","username":"o.chaze"},"change_message_id":"a6b958225a46b187ddbef348ff933ccaceaeacd8","unresolved":false,"context_lines":[{"line_number":137,"context_line":"            self.frame_model,"},{"line_number":138,"context_line":"            session)"},{"line_number":139,"context_line":"        q \u003d q.filter("},{"line_number":140,"context_line":"            self.frame_model.begin.between(begin, end),"},{"line_number":141,"context_line":"            self.frame_model.end \u003c\u003d end)"},{"line_number":142,"context_line":"        tenants \u003d q.distinct().values("},{"line_number":143,"context_line":"            self.frame_model.tenant_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"549f3e1b_bfce9aa8","line":140,"in_reply_to":"4e2644c2_c4e32c95","updated":"2022-11-29 08:21:34.000000000","message":"I adapted the description.\nOptimization also depends on https://review.opendev.org/c/openstack/cloudkitty/+/865435","commit_id":"63ad92623fd3e13c19a5ab382d8a55e4b32ec970"},{"author":{"_account_id":29422,"name":"Olivier Chaze","display_name":"Olivier Chaze","email":"olivier.chaze@infomaniak.com","username":"o.chaze"},"change_message_id":"80fcc3a3d75a3e5861933dcbfd6de380143d66a8","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                self.frame_model.res_type \u003d\u003d service)"},{"line_number":115,"context_line":"        q \u003d q.filter("},{"line_number":116,"context_line":"            self.frame_model.begin.between(begin, end),"},{"line_number":117,"context_line":"            self.frame_model.end.between(begin, end),"},{"line_number":118,"context_line":"            self.frame_model.res_type !\u003d \u0027_NO_DATA_\u0027)"},{"line_number":119,"context_line":"        if groupby:"},{"line_number":120,"context_line":"            q \u003d q.group_by(sqlalchemy.sql.text(groupby))"}],"source_content_type":"text/x-python","patch_set":6,"id":"b066d835_85fa87f2","line":117,"updated":"2022-12-05 12:40:32.000000000","message":"Rewritting the using \"BETWEEN\" statement here like I did for the `self.frame_model.begin` filter as it confuses people.  I\u0027m afraid that one day someone will remove this line thinking it is useless while it is mandotory otherwise queries result would be different.","commit_id":"0b594698d69ba2b97f478f087f6d390ada322ec3"},{"author":{"_account_id":29422,"name":"Olivier Chaze","display_name":"Olivier Chaze","email":"olivier.chaze@infomaniak.com","username":"o.chaze"},"change_message_id":"11383312407662c0863c15fd083fdb5e451cce40","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                self.frame_model.res_type \u003d\u003d service)"},{"line_number":115,"context_line":"        q \u003d q.filter("},{"line_number":116,"context_line":"            self.frame_model.begin.between(begin, end),"},{"line_number":117,"context_line":"            self.frame_model.end.between(begin, end),"},{"line_number":118,"context_line":"            self.frame_model.res_type !\u003d \u0027_NO_DATA_\u0027)"},{"line_number":119,"context_line":"        if groupby:"},{"line_number":120,"context_line":"            q \u003d q.group_by(sqlalchemy.sql.text(groupby))"}],"source_content_type":"text/x-python","patch_set":6,"id":"f9d2e866_947d1c09","line":117,"in_reply_to":"4b7d1556_0efe75f9","updated":"2022-12-06 07:43:44.000000000","message":"Hi Rafael, unit test are already there actually so we should be safe.\nI added a comment in the code.","commit_id":"0b594698d69ba2b97f478f087f6d390ada322ec3"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"74f679e79e30a8fb3d16b69e92304c02bcbeab85","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                self.frame_model.res_type \u003d\u003d service)"},{"line_number":115,"context_line":"        q \u003d q.filter("},{"line_number":116,"context_line":"            self.frame_model.begin.between(begin, end),"},{"line_number":117,"context_line":"            self.frame_model.end.between(begin, end),"},{"line_number":118,"context_line":"            self.frame_model.res_type !\u003d \u0027_NO_DATA_\u0027)"},{"line_number":119,"context_line":"        if groupby:"},{"line_number":120,"context_line":"            q \u003d q.group_by(sqlalchemy.sql.text(groupby))"}],"source_content_type":"text/x-python","patch_set":6,"id":"4b7d1556_0efe75f9","line":117,"in_reply_to":"b066d835_85fa87f2","updated":"2022-12-05 12:43:09.000000000","message":"You can add a comment explaining why that is needed, and maybe a unit test to assure that this code is maintained throughout time.","commit_id":"0b594698d69ba2b97f478f087f6d390ada322ec3"}],"releasenotes/notes/optimizing-sql-queries-939f48fff1805389.yaml":[{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"3825841837aa08f2d530ce69adf2c08325ef0149","unresolved":true,"context_lines":[{"line_number":9,"context_line":"    of \u003e\u003d"},{"line_number":10,"context_line":"    The BETWEEN statement requires an indexes to be efficient which are"},{"line_number":11,"context_line":"    https://review.opendev.org/c/openstack/cloudkitty/+/865435/"},{"line_number":12,"context_line":"    List new features here, or remove this section.  All of the list items in"},{"line_number":13,"context_line":"    this section are combined when the release notes are rendered, so the text"},{"line_number":14,"context_line":"    needs to be worded so that it does not depend on any information only"},{"line_number":15,"context_line":"    available in another section, such as the prelude. This may mean repeating"},{"line_number":16,"context_line":"    some details."}],"source_content_type":"text/x-yaml","patch_set":9,"id":"fadd12db_88cb6991","line":16,"range":{"start_line":12,"start_character":0,"end_line":16,"end_character":17},"updated":"2023-02-20 14:39:44.000000000","message":"Please fix release note.","commit_id":"581fe3f2e9f6af440e2e2215f573f4c326ca9738"}]}
