On 06 Jun 11:25, Cédric Krier wrote: > On 05 Jun 12:37, Cédric Krier wrote: > > On 05 Jun 00:20, Albert Cervera i Areny wrote: > > > 2015-06-04 19:11 GMT+02:00 Jordi Esteve <[email protected]>: > > > Anyway, I don't know how hard it would be to make tryton generate a > > > better query. > > > > I think both queries have their advantage indeed it depends on the size > > of each tables. > > In our case, a join is faster because the database will make a join > > between a small set of tuple from "account_invoice_line-stock_move" with > > a large table "account_invoice_line". Instead of retrieving almost all > > the tuples from "account_invoice_line" to make the IN test. > > But if the table size were different then a IN clause could have better > > performance. > > > > So I think the improvement should add a parameter on the Many2One > > definition to define which kind of "nested" search strategy it should > > use. > > I wrote a quick POC of this patch at https://bugs.tryton.org/issue4798 > It will be great to get some timing report between both options on large > database.
Indeed it is no more a POC but a patch ready for review and testing. -- Cédric Krier - B2CK SPRL Email/Jabber: [email protected] Tel: +32 472 54 46 59 Website: http://www.b2ck.com/
