#NEWLINE# def _setupTroveList( self , cu , troveList ) : #NEWLINE# #INDENT# if ( not troveList ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# schema . resetTable ( cu , 'tmpInstances' ) #NEWLINE# schema . resetTable ( cu , 'tmpId' ) #NEWLINE# cu . executemany ( '\n        insert into tmpInstances(instanceId)\n        select instanceId\n        from Instances\n        join Items on Instances.itemId = Items.itemId\n        JOIN versions on Instances.versionId = Versions.versionId\n        join Flavors on Instances.flavorId = Flavors.flavorId\n        where Items.item = ? and Versions.version = ? and Flavors.flavor = ?\n        ' , troveList , start_transaction = False ) #NEWLINE# self . db . analyze ( 'tmpInstances' ) #NEWLINE# cu . execute ( '\n        insert into tmpId(id)\n        select distinct tt.includedId\n        from tmpInstances as ti\n        join TroveTroves as tt using(instanceId)\n        ' , start_transaction = False ) #NEWLINE# cu . execute ( 'delete from tmpId where id in (select instanceId from tmpInstances)' , start_transaction = False ) #NEWLINE# cu . execute ( 'insert into tmpInstances(instanceId) select id from tmpId' , start_transaction = False ) #NEWLINE# self . db . analyze ( 'tmpInstances' )