On 10/25/12, Peter Koželj <[email protected]> wrote: > On Thu, Oct 25, 2012 at 12:16 AM, Ryan Ollos > <[email protected]>wrote: > >> On Wed, Oct 24, 2012 at 5:29 AM, Peter Koželj <[email protected]> wrote: >> [...] >> >> When milestone, component and version are updated, the updates to the >> milestone/component/version table and tickets table occur in a single >> transaction (3), per my limited understanding. Priority and Severity are >> less fortunate, as the definitions of these fields are stored in >> trac.ini, >> and changes to the values will not result in any ticket updates. >> >> (1) http://trac.edgewall.org/ticket/10925 >> (2) http://trac.edgewall.org/ticket/5658 >> (3) >> >> http://trac.edgewall.org/browser/trunk/trac/ticket/model.py?marks=1061,1064-1069,1075-1076&rev=11359#L1051 > > > That code for milestone update (reference 3) is ok (given the datamodel). > However in bloodhound_multiproduct/multiproduct/model.py > Product._update_relations() you can find this: > > for t in Product.get_tickets(self._env, old_name): > ticket = Ticket(self._env, t['id'], db) > ticket['product'] = new_name > ticket.save_changes(author, comment, now) > > > Not sure if it is single transaction or not,
it does not seem so > but it is N SQL updates for > sure. > > If you have 10000 tickets in a product, that will be 10000 roundtrips to > the SQL server. > yes ... we are the ones who have to improve that code snippet and use transactions and/or something more efficient . -- Regards, Olemis. Blog ES: http://simelo-es.blogspot.com/ Blog EN: http://simelo-en.blogspot.com/ Featured article:
