Wednesday, December 13, 2023
1 change · 17.0
Enhancements to existing features
This update optimizes how the system retrieves and displays project tasks, particularly when viewing projects with many completed tasks. By improving how the database searches for open tasks, the system now performs up to 10 times faster when loading project views with thousands of tasks, resulting in a noticeably snappier user experience.
Original PR description
## Description Indexes on a Selection field are never used in a `NOT IN` where clause, as PostgreSQL doesn't have the complementary values (in DB a Selection field is just a VarChar) to make use of an index on the field. The ORM currently doesn't invert `not in <selection>` -> `in <complement of selection>`. ## Benchmark Positive impact in the project modules all around, specially for long running projects where the proportion of "done" tasks are >90% of the project's task. On a populated project with 10k tasks, 200 of those are open, there were around 10x improvement on the requests linked to rendering the kanban view of the project. More elaborate benchmarks are available in the referenced task. ## Reference task-3576802 ## Related PR: https://github.com/odoo/odoo/pull/146120 Forward-Port-Of: odoo/enterprise#52689