Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] stock: pre-compute quantity_done #4475

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

chienandalu
Copy link
Member

The field stock.move.quantity_done has passed to be stored.

In large databases (millions of records) it takes a good amount of time to compute it by the ORM, so it's worth it to pre-compute its values as much as possible.

In a database with 12M stock_move records we go from 1h15m with pure ORM to 18minutes

cc @Tecnativa TT46020

@legalsylvain legalsylvain added this to the 16.0 milestone Jun 26, 2024
@chienandalu chienandalu force-pushed the 16.0-imp-stock-perf branch 2 times, most recently from e16e7ba to 74a5994 Compare October 24, 2024 07:15
@legalsylvain
Copy link
Contributor

Hi @chienandalu. What is the state of this PR ? could you apply @pedrobaeza proposal to get this one merged ?
thanks !

@chienandalu chienandalu marked this pull request as ready for review November 8, 2024 07:37
The field stock.move.quantity_done has passed to be stored.

In large databases (millions of records) it takes a good amount of time
to compute it by the ORM, so it's worth it to pre-compute its values as
much as possible.

TT46020
@chienandalu
Copy link
Member Author

I had the other query to reformat to a more compact version. Now it should be ok

@pedrobaeza pedrobaeza merged commit f185ced into OCA:16.0 Nov 8, 2024
2 checks passed
@pedrobaeza pedrobaeza deleted the 16.0-imp-stock-perf branch November 8, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants