odoo/odoo#143543
Created by Benjamin Hanquin (beha)
Merged
at f128981414e63e278357766a57c99426e33e557d
- label
- odoo-dev:15.0-product-fix_speedup_name_search_no_variants-beha
- head
- 4766bad1aebbbeec31ccfdbe367490701c3a9235
- target
- 15.0
- merged
- 6 months ago by Benjamin Hanquin (beha)
- forward-ports
- odoo/odoo#145105 targeting master
- odoo/odoo#145095 targeting 17.0
- odoo/odoo#145004 targeting saas-16.4
- odoo/odoo#144891 targeting saas-16.3
- odoo/odoo#144756 targeting saas-16.2
- odoo/odoo#144746 targeting saas-16.1
- odoo/odoo#144678 targeting 16.0
- odoo/odoo#144623 targeting saas-15.2
[PERF] product: Improve name_search performance
# 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