details: http://www.bx.psu.edu/hg/galaxy/rev/e9971a098d14 changeset: 2358:e9971a098d14 user: Nate Coraor <nate@bx.psu.edu> date: Tue Apr 21 10:45:13 2009 -0400 description: lazyload Job properties when tracking jobs in database to speed up queries 1 file(s) affected in this change: lib/galaxy/jobs/__init__.py diffs (20 lines): diff -r 5a0100a94b12 -r e9971a098d14 lib/galaxy/jobs/__init__.py --- a/lib/galaxy/jobs/__init__.py Tue Apr 21 10:26:58 2009 -0400 +++ b/lib/galaxy/jobs/__init__.py Tue Apr 21 10:45:13 2009 -0400 @@ -2,6 +2,7 @@ from galaxy import util, model from galaxy.model import mapping +from galaxy.model.orm import lazyload from galaxy.datatypes.tabular import * from galaxy.datatypes.interval import * from galaxy.datatypes import metadata @@ -158,7 +159,7 @@ # Pull all new jobs from the queue at once new_jobs = [] if self.track_jobs_in_database: - for j in session.query( model.Job ).filter( model.Job.c.state == model.Job.states.NEW ).all(): + for j in session.query( model.Job ).options( lazyload( "external_output_metadata" ), lazyload( "parameters" ) ).filter( model.Job.c.state == model.Job.states.NEW ).all(): job = JobWrapper( j, self.app.toolbox.tools_by_id[ j.tool_id ], self ) new_jobs.append( job ) else: