]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Change lazy='dynamic' to 'joined' in models_v2
authorAaron Rosen <arosen@nicira.com>
Wed, 5 Jun 2013 00:19:07 +0000 (17:19 -0700)
committerarosen <arosen@nicira.com>
Sun, 9 Jun 2013 01:59:35 +0000 (18:59 -0700)
commit6c510bce812900af1b69f346d8f46a2cc5a8fe8c
treede537fe98e8347f734f9326dd2232120e2cea8ec
parent78c3f890c98baa32c34aad213fbc6b231c9d142a
Change lazy='dynamic' to 'joined' in models_v2

Previously several models were defined with lazy='dynamic'. This would
then cause Ports.fixed_ips (or w/e was specified as dynamic) to be defined
as a AppenderQuery object and when accessed would query for the result.
Therefore in get_ports() for example, when fixed_ips was accessed
in _make_port_dict() we would be issuing an addition query to the database
to lookup the fixed_ips information.

This patch changes update_port/subnet() so that it keeps track of what
changed so it does not have to query the db for values it should already
know about.

This patch also adds a unit test for update_subnet() adding host routes
where there was missing code coverage.

Implements blueprint improve-db-performance

Change-Id: I0b2214604042a1fd362cbbf3fd70e31adf0ce279
quantum/db/db_base_plugin_v2.py
quantum/db/l3_db.py
quantum/db/models_v2.py
quantum/tests/unit/test_db_plugin.py