]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Subnets should be set as lazy='join'
authorAaron Rosen <aaronorosen@gmail.com>
Wed, 26 Mar 2014 20:52:05 +0000 (13:52 -0700)
committerAaron Rosen <aaronorosen@gmail.com>
Wed, 26 Mar 2014 20:56:38 +0000 (13:56 -0700)
commitcbeda85fe5284d2ec0ba39976cdf6ffcdfbdd84a
treebddf4fda847afedca12d58507fbf232fc6bf96ad
parent96c0928a46119e9bbebf69f1734875f864f1e51f
Subnets should be set as lazy='join'

Currently if one does a net-list tons of queries are issued against the
database as the default query mode is 'select' which performs a query when
the field is actually accessed. In this patch I change the the mode to
'joined' so subnets are loaded as the networks are loaded. Usually, there
are only 1 or 2 subnets on a network so loading this data shouldn't hurt.
This patch in my setup with 5000 networks reduces the net-list call from 27
seconds to 7! Woot Woot :)

Change-Id: I10eec4d79b522dfd685d3d2aa93a8d643104bba7
Closes-bug: 1298053
neutron/db/models_v2.py