Perform eager caching of machine properties.
authorEric Price <ecprice@mit.edu>
Mon, 2 Jun 2008 05:49:32 +0000 (01:49 -0400)
committerEric Price <ecprice@mit.edu>
Mon, 2 Jun 2008 05:49:32 +0000 (01:49 -0400)
svn path=/trunk/packages/sipb-xen-database/; revision=555

debian/changelog
sipb_xen_database/models.py

index 203c44e..1f03aa8 100644 (file)
@@ -1,5 +1,11 @@
 sipb-xen-database (10.8) unstable; urgency=low
 
+  * Eager loading of relations for better performance.
+
+ -- Eric Price <ecprice@pseudomyrmex.mit.edu>  Mon, 02 Jun 2008 01:39:11 -0400
+
+sipb-xen-database (10.8) unstable; urgency=low
+
   * Configure serial console on boot
 
  -- Quentin Smith <quentin@sipb-xen-dev.mit.edu>  Thu,  1 May 2008 20:21:25 -0400
index 3f54821..1090531 100644 (file)
@@ -100,10 +100,10 @@ class Autoinstall(object):
         return "<Autoinstall %s: %s (%s)>" % (self.autoinstall_id, self.description, self.type.type_id)
 
 assign_mapper(ctx, Machine, machine_table,
-              properties={'nics': relation(NIC, backref="machine"),
-                          'disks': relation(Disk, backref="machine"),
-                          'type': relation(Type),
-                          'acl': relation(MachineAccess, backref="machine")});
+              properties={'nics': relation(NIC, backref="machine", lazy=False),
+                          'disks': relation(Disk, backref="machine", lazy=False),
+                          'type': relation(Type, lazy=False),
+                          'acl': relation(MachineAccess, backref="machine", lazy=False)});
 assign_mapper(ctx, MachineAccess, machine_access_table)
 assign_mapper(ctx, NIC, nic_table)
 assign_mapper(ctx, Disk, disk_table)