neutron-lbaas/neutron_lbaas/db
Jan Zerebecki b9b6b6a272 Improve speed of listing from DB
This removes from_sqlalchemy_model and the related object intermediary
representation from get_loabalancers, get_pools, get_listeners,
get_healthmonitors, get_l7policies, get_l7policy_rules,
get_pool_members.
Instead it more directly transforms from the SQLAlchemy model to the
required api dictionary format. Thus this entierly skips loading a few
relations that walking the intermediary object model triggered without
the target output needing them.

Use eager loading specified at query time where the api dictionary
representation is needed, as the relations needed for it are always the
same.

Removes eager loading from the model of the relations
L7Policy[rules]->L7Rule[policy] and
Listener[l7_policies]->L7Policy[listener] and
Listener[default_pool]->PoolV2[listeners].

These relations are sometimes unncessarily loaded and then never used.
E.g. the API dictionary format for loadbalancers does include policies
but not rules; does include listeners but not any L7Policy.

In a test with a bit more than 100 LBs this improved the speed of a cli
call of lbaas-loadbalancer-list from 50.932s to 2.335s. It similarly
improved lbaas-pool-list and lbaas-listener-list,
lbaas-healthmonitor-list, lbaas-l7policy-list, lbaas-l7rule-list,
lbaas-member-list.

This continues what I9d67f0966561baaefb50ae97b943ff6593e194eb started.

Story: 2001962
Change-Id: I32328c5206b9cd6fb8d8764c079f22b6ea8bfa9e
(cherry picked from commit 397a6fe39c)
2018-10-17 16:45:43 +00:00
..
loadbalancer Improve speed of listing from DB 2018-10-17 16:45:43 +00:00
migration Fix pep8 errors 2018-04-13 10:10:47 +00:00
models Nuke lbaas v1 2016-08-23 13:05:48 -05:00
__init__.py Split lbaas services code into neutron-lbaas 2014-12-08 13:37:18 -07:00