Wednesday, November 8, 2023
1 change · 17.0
Enhancements to existing features
The Knowledge article search feature, accessed through the command palette, is now significantly faster. The improvements include optimizing how the system determines favorite articles and implementing a more efficient database query for sorting results. Users searching through thousands of articles will experience up to 15 times faster search performance.
Original PR description
Searching a Knowledge article through the command palette was very slow, mostly because the search results were sorted using computed fields in Python. This work contains 2 performance improvements…
Searching a Knowledge article through the command palette was very slow, mostly because the search results were sorted using computed fields in Python. This work contains 2 performance improvements to `get_user_sorted_articles`: - Improve the computation time of `_compute_is_user_favorite` in Python - Implement a custom SQL query for `get_user_sorted_articles` so that the ordering is done entirely in SQL. A query count test is introduced for `get_user_sorted_articles` first and is updated throughout the commits as a visual check for the improvements. Called with a recordset of ~1000 articles,`_compute_is_user_favorite` was observed to be ~8 times faster. A complete search (empty search query) with `get_user_sorted_articles` on a database of ~3000 articles was observed to be ~15 times faster. See each commit for more details. See [the community PR] for the fix to the command palette. [the community PR]: https://github.com/odoo/odoo/pull/140545 task-3554068 Forward-Port-Of: odoo/enterprise#50372 Forward-Port-Of: odoo/enterprise#48945