Skip to content

[IMP] base/0.0.0: speedup the recomputation of commercial partner#462

Closed
hpr-odoo wants to merge 1 commit into
odoo:masterfrom
odoo-dev:master-improve-performance-to-set-commercial_partner-hpr
Closed

[IMP] base/0.0.0: speedup the recomputation of commercial partner#462
hpr-odoo wants to merge 1 commit into
odoo:masterfrom
odoo-dev:master-improve-performance-to-set-commercial_partner-hpr

Conversation

@hpr-odoo

@hpr-odoo hpr-odoo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor
  • with default chunk_size(256) system estimating more time and also taking so

  • after increase the chunk_size it's performing well and finish faster

  • data:

4449419=> select count(*) from res_partner where commercial_partner_id is null;
  count
---------
 1252548
(1 row)
  • Below are findings with different chunk_size:
  • with default(256): didn't wait to finish
2026-07-08 13:59:47,979 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  0.02%]             1/4893 res.partner 256-bucket processed in 0:08:44.330250 (total estimated time: 29 days, 16:45:47.305433)
2026-07-08 14:07:21,784 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  0.04%]             2/4893 res.partner 256-bucket processed in 0:16:18.134600 (total estimated time: 27 days, 16:49:38.830632)
  • with 10000: finihsed in 1:30 Hour
2026-07-08 15:34:33,702 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  0.79%]        1/126 res.partner 10000-bucket processed in 0:11:15.066825 (total estimated time: 23:40:30.359470)
2026-07-08 15:36:34,885 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  1.58%]        2/126 res.partner 10000-bucket processed in 0:13:16.250650 (total estimated time: 13:57:45.193470)
  • with 20000: finished in 1:20 Hour
2026-07-09 09:14:47,222 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  1.57%]        1/63 res.partner 20000-bucket processed in 0:16:12.657663 (total estimated time: 17:11:27.629554)
2026-07-09 09:16:37,316 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  3.14%]        2/63 res.partner 20000-bucket processed in 0:18:02.752284 (total estimated time: 9:34:06.329269)
  • with 50000: finished in 1 Hour
2026-07-09 12:50:24,982 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  3.84%]        1/26 res.partner 50000-bucket processed in 0:17:37.070681 (total estimated time: 7:38:57.684886)
2026-07-09 12:53:46,389 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  7.68%]        2/26 res.partner 50000-bucket processed in 0:20:58.476944 (total estimated time: 4:33:12.253680)

@robodoo

robodoo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Pull request status dashboard

@hpr-odoo
hpr-odoo force-pushed the master-improve-performance-to-set-commercial_partner-hpr branch from 953b3ba to e46b82b Compare July 9, 2026 18:03
@hpr-odoo

hpr-odoo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

50K will be more faster but this may problematic for multiple hierarchy if there, so as far my understanding 10K will be more reliable 🤔

@hpr-odoo
hpr-odoo requested review from a team and sagu-odoo July 9, 2026 18:09
@sagu-odoo

Copy link
Copy Markdown
Contributor

can you please try with strategy = commit ?.

@hpr-odoo
hpr-odoo force-pushed the master-improve-performance-to-set-commercial_partner-hpr branch from e46b82b to ee4b655 Compare July 10, 2026 07:45
@hpr-odoo

hpr-odoo commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

can you please try with strategy = commit ?.

It's not effecting to the speed

2026-07-10 07:32:56,256 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  0.79%]        1/126 res.partner 10000-bucket processed in 0:14:32.813219 (total estimated time: 1 day, 6:36:36.771121) 
2026-07-10 07:35:42,760 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  1.58%]        2/126 res.partner 10000-bucket processed in 0:17:19.317190 (total estimated time: 18:13:29.340014)

had avoided because of simple logic for compute the field and not involved any tracked field so.
Thank you for your review 🫡

@hpr-odoo
hpr-odoo force-pushed the master-improve-performance-to-set-commercial_partner-hpr branch 2 times, most recently from e18860c to 5395a6a Compare July 10, 2026 07:53
@sagu-odoo
sagu-odoo requested review from a team and apan-odoo July 10, 2026 13:12
@KangOl

KangOl commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Use the query argument of recompute_field

- with default chunk_size(256) system estimating more time and
 also taking more time
- after increase the chunk_size it's performing well and finish faster

- data:
```sql
4449419=> select count(*) from res_partner where commercial_partner_id is null;
  count
---------
 1252548
(1 row)
```
- Below are findings with different chunk_size:
- with default(256): didn't wait to finish
```py
2026-07-08 13:59:47,979 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  0.02%]             1/4893 res.partner 256-bucket processed in 0:08:44.330250 (total estimated time: 29 days, 16:45:47.305433)
2026-07-08 14:07:21,784 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  0.04%]             2/4893 res.partner 256-bucket processed in 0:16:18.134600 (total estimated time: 27 days, 16:49:38.830632)
```
- with 10000: finihsed in 1:30 Hour
```py
2026-07-08 15:34:33,702 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  0.79%]        1/126 res.partner 10000-bucket processed in 0:11:15.066825 (total estimated time: 23:40:30.359470)
2026-07-08 15:36:34,885 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  1.58%]        2/126 res.partner 10000-bucket processed in 0:13:16.250650 (total estimated time: 13:57:45.193470)
```

- with 20000: finished in 1:20 Hour
```py
2026-07-09 09:14:47,222 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  1.57%]        1/63 res.partner 20000-bucket processed in 0:16:12.657663 (total estimated time: 17:11:27.629554)
2026-07-09 09:16:37,316 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  3.14%]        2/63 res.partner 20000-bucket processed in 0:18:02.752284 (total estimated time: 9:34:06.329269)
```

- with 50000: finished in 1 Hour
```py
2026-07-09 12:50:24,982 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  3.84%]        1/26 res.partner 50000-bucket processed in 0:17:37.070681 (total estimated time: 7:38:57.684886)
2026-07-09 12:53:46,389 23 INFO hpr_4449419_19.0 odoo.upgrade.util.orm: [  7.68%]        2/26 res.partner 50000-bucket processed in 0:20:58.476944 (total estimated time: 4:33:12.253680)
```

- UPG-[4449419]
@hpr-odoo
hpr-odoo force-pushed the master-improve-performance-to-set-commercial_partner-hpr branch from 5395a6a to f8a4bd8 Compare July 10, 2026 15:28
@hpr-odoo

Copy link
Copy Markdown
Contributor Author

Use the query argument of recompute_field

Thank you for the great suggestion, that was in my mind but because of rowcount keep it same.
But found the same thing is there in recompute_fields itself.
Changes are done 🫡

@aj-fuentes aj-fuentes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

5 participants