Skip to content

Conversation

@fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Mar 7, 2025

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

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.

X-original-commit: b81314b
@robodoo
Copy link
Contributor

robodoo commented Mar 7, 2025

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 7, 2025

This PR targets saas-18.2 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Mar 7, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 7, 2025

@ethanrobv ci/runbot failed on this forward-port PR

@C3POdoo C3POdoo added the RD research & development, internal work label Mar 7, 2025
robodoo pushed a commit that referenced this pull request Mar 8, 2025
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.

closes #200811

X-original-commit: b81314b
Signed-off-by: Vincent Ethan <etvi@odoo.com>
@robodoo robodoo closed this Mar 8, 2025
@fw-bot fw-bot deleted the saas-18.2-saas-17.4-report-stock-quantity-quadratic-time-join-slow-etvi-421312-fw branch March 15, 2025 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

forwardport This PR was created by @fw-bot RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants