Skip to content

Conversation

@fw-bot
Copy link
Contributor

@fw-bot fw-bot commented 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.

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 8, 2025

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 8, 2025

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Mar 8, 2025
@C3POdoo C3POdoo added the RD research & development, internal work label Mar 8, 2025
@ethanrobv
Copy link

@robodoo r+

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 #200877

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

Labels

18.3 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.

4 participants