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

[PERF] product: Improve name_search performance #143543

Conversation

BHanq
Copy link

@BHanq BHanq commented Nov 24, 2023

Issue:

The name_search performance was highly inefficient with a high number of records.

Analyze:

The bottleneck came from the NOT IN search on the product_template.

Fix:

As a NOT IN is not efficient, an not exists must be used.

Note:

The ORM has to be bypassed has no "not exists" feature has been implemented yet.

Benchmark:

# Input data Before PR After PR
182386 15+ min ~100 ms
29 ~29 ms ~28 ms

Related task:

opw-3554133

@robodoo
Copy link
Contributor

robodoo commented Nov 24, 2023

@C3POdoo C3POdoo requested a review from a team November 24, 2023 11:33
@BHanq BHanq force-pushed the 15.0-product-fix_speedup_name_search_no_variants-beha branch from b34222b to f50ccf9 Compare November 24, 2023 11:45
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Nov 24, 2023
Copy link
Contributor

@vava-odoo vava-odoo left a comment

Choose a reason for hiding this comment

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

Thanks for this. It looks good to me*, although I'd like another one from the team to validate as I'm not an expert in sql.

*Could you better indent the sql query? (why is it on the right-hand side?)

@BHanq BHanq force-pushed the 15.0-product-fix_speedup_name_search_no_variants-beha branch from f50ccf9 to c0ef201 Compare November 27, 2023 09:21
@BHanq
Copy link
Author

BHanq commented Nov 27, 2023

*Could you better indent the sql query? (why is it on the right-hand side?)

Done

Issue:
The name_search performance was highly inefficient with a high number of
records.

Analyze:
The bottleneck came from the NOT IN search on the product_template.

Fix:
As a NOT IN  is not efficient, an not exists must be used.

Note:
The ORM has to be bypassed has no "not exists" feature has been
implemented yet.

Benchmark:
| # Input data | Before PR | After PR |
|:-------------:|:----------:|:---------:|
| 182386                    |     15+ min           |   ~100 ms |
|       29            |      ~29 ms          |    ~28 ms           |

Related task:
opw-3554133
@BHanq BHanq force-pushed the 15.0-product-fix_speedup_name_search_no_variants-beha branch from 3623419 to 4766bad Compare November 28, 2023 11:48
@awa-odoo
Copy link
Contributor

Hello @Feyensv

I really need to remove this FIXME, as this has little to do with the base code anymore
78c3cf7

Hence I'm not the best person to ask a review to.

@Feyensv Feyensv removed the request for review from awa-odoo November 28, 2023 12:48
@Feyensv
Copy link
Contributor

Feyensv commented Nov 28, 2023

My bad for the ping then, we'll remove it for you :D
Thanks for the answer ❤️

@Yenthe666
Copy link
Collaborator

oooh momma 🚀

Copy link
Contributor

@Feyensv Feyensv left a comment

Choose a reason for hiding this comment

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

@robodoo delegate+

@BHanq
Copy link
Author

BHanq commented Dec 1, 2023

@robodoo r+

robodoo pushed a commit that referenced this pull request Dec 1, 2023
Issue:
The name_search performance was highly inefficient with a high number of
records.

Analyze:
The bottleneck came from the NOT IN search on the product_template.

Fix:
As a NOT IN  is not efficient, an not exists must be used.

Note:
The ORM has to be bypassed has no "not exists" feature has been
implemented yet.

Benchmark:
| # Input data | Before PR | After PR |
|:-------------:|:----------:|:---------:|
| 182386                    |     15+ min           |   ~100 ms |
|       29            |      ~29 ms          |    ~28 ms           |

Related task:
opw-3554133

closes #143543

Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
@robodoo robodoo closed this Dec 1, 2023
@liebana
Copy link

liebana commented Dec 4, 2023

Hello @BHanq and Odoo Team (@Feyensv @awa-odoo @vava-odoo )

Thanks for the improvement. Have you identified any other bottleneck like this? Do you have any kind of performance roadmap that you can share with us?

Thanks in advance :)

@BHanq
Copy link
Author

BHanq commented Dec 4, 2023

Hello @ilebana

Thanks for your interest in our work.

We have no roadmap, you can check PRs starting with the [PERF] prefix. We works mainly based on ticket that Odoo's user open in our Helpdesk. So if you have bottleneck you would like to be fix, please open a ticket (https://www.odoo.com/help). We'll be glad to help you.

Regards,

@fw-bot
Copy link
Contributor

fw-bot commented Dec 5, 2023

fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Mar 29, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to odoo#143543.

X-original-commit: 12fe740
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Mar 29, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to odoo#143543.

X-original-commit: 12fe740
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Mar 29, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to odoo#143543.

X-original-commit: 12fe740
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Mar 29, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to odoo#143543.

X-original-commit: 12fe740
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Mar 29, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to odoo#143543.

X-original-commit: 12fe740
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Mar 29, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to odoo#143543.

X-original-commit: 12fe740
robodoo pushed a commit that referenced this pull request Apr 1, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to #143543.

closes #159907

X-original-commit: 12fe740
Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 1, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to #143543.

closes #159886

X-original-commit: 12fe740
Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 1, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to #143543.

closes #159933

X-original-commit: 12fe740
Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 1, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to #143543.

closes #159965

X-original-commit: 12fe740
Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 1, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to #143543.

closes #159999

X-original-commit: 12fe740
Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 1, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to #143543.

closes #159965

X-original-commit: 12fe740
Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 2, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to #143543.

closes #160018

X-original-commit: 12fe740
Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 2, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to #143543.

closes #159933

X-original-commit: 12fe740
Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
willylohws pushed a commit to willylohws/odoo that referenced this pull request May 1, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to odoo#143543.

closes odoo#159818

X-original-commit: a949ae1
Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
willylohws pushed a commit to willylohws/odoo that referenced this pull request May 1, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to odoo#143543.

closes odoo#159933

X-original-commit: 12fe740
Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
willylohws pushed a commit to willylohws/odoo that referenced this pull request May 1, 2024
Some tests on dynamic variants mechanism didn't pass on test
without demo data due to odoo#143543.

closes odoo#159709

Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
leemannd pushed a commit to camptocamp/odoo that referenced this pull request May 7, 2024
Issue:
The name_search performance was highly inefficient with a high number of
records.

Analyze:
The bottleneck came from the NOT IN search on the product_template.

Fix:
As a NOT IN  is not efficient, an not exists must be used.

Note:
The ORM has to be bypassed has no "not exists" feature has been
implemented yet.

Benchmark:
| # Input data | Before PR | After PR |
|:-------------:|:----------:|:---------:|
| 182386                    |     15+ min           |   ~100 ms |
|       29            |      ~29 ms          |    ~28 ms           |

Related task:
opw-3554133

closes odoo#143543

Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
PaoloYam pushed a commit to camptocamp/odoo that referenced this pull request May 7, 2024
Issue:
The name_search performance was highly inefficient with a high number of
records.

Analyze:
The bottleneck came from the NOT IN search on the product_template.

Fix:
As a NOT IN  is not efficient, an not exists must be used.

Note:
The ORM has to be bypassed has no "not exists" feature has been
implemented yet.

Benchmark:
| # Input data | Before PR | After PR |
|:-------------:|:----------:|:---------:|
| 182386                    |     15+ min           |   ~100 ms |
|       29            |      ~29 ms          |    ~28 ms           |

Related task:
opw-3554133

closes odoo#143543

Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants