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
closesodoo/odoo#145095
X-original-commit: 955d28a485d569569af2792fa014b52c1829d178
Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>