odoo/odoo#200760

Created by fw-bot
Merged at c6acf3a156c31f9b8ff0d804a5a77bae29cf705b

Statuses:

label
odoo-dev:18.0-saas-17.4-report-stock-quantity-quadratic-time-join-slow-etvi-421153-fw
head
d5e8cb9f2f409471152b67a80e2e071d70521d05
merged
8 months ago by Vincent Ethan
odoo/odoo
saas-17.4 #200682
18.0 #200760
saas-18.1 #200788
saas-18.2 #200811
saas-18.3
saas-18.4
19.0
master #200877

[FW][PERF] stock: CASE in JOIN on dest/final_id

We need to use either location_dest_id or location_final_id in the stock quantity report. Commit e16b3bc adds the logic for this but implements it using a CASE in the JOIN which the planner selects a nested loop based plan to accomplish (quadratic time).

Change it here to a boolean expression which can be better optimized by the query planner.

Forward-Port-Of: #200682