On 13/10/09 21:25 +0200, Cédric Krier wrote:
> On 13/10/09 08:46 -0700, B.V. wrote:
> > 
> > Hello,
> > 
> > We are experiencing quite worrying performance issues with tryton-1.2,
> > especially on purchase and account_invoices modules.
> > 
> > We have a database with about 2600 purchase orders and 45000 purchase
> > order lines.
> > 
> > Reading 80 orders (1350 lines) takes more than 9 seconds (measured
> > with a script) for following fields: 'reference', 'untaxed_amount',
> > 'tax_amount' and 'total_amount'. The given time is taken after
> > executing several times the same script.
> > 
> > Having a look on postgresql log, we saw numerous queries to
> > account_tax (always same 3 queries [1][2][3]): each one is called 2700
> > times.
> 
> This is improved a lot on 1.3 with the cache on cursor.
> In my test, I have only one query of each kind for 10 purchase orders.

A possible solution would change compute on account.tax to accept
BrowseRecord, add on get_tax_amount a cache of BrowseRecords for account.tax
and use the cached BrowseRecords to call commpute.


-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email: [email protected]
Jabber: [email protected]
Website: http://www.b2ck.com/

Attachment: pgpvLQihq0IyP.pgp
Description: PGP signature

Reply via email to