commit a802b382d331423bf3449665dcfa7c48d7b8e094
Author: Kevin Benton <email address hidden>
Date: Mon Dec 12 11:36:51 2016 -0800
Use subqueries for rbac_entries and subnets<->network
Loading subnets as part of the networks list and networks
as part of the subnets list appears to have a significant
impact when the network has tags and the subnets have
extra routes entries. This is even further compounded by
the network having rbac entries (likely due to the subnet
inheriting the RBAC entries of the network with the custom
join condition in the model).
This patch converts rbac_entries on both subnet and network
to use a subquery and converts the network and subnets
relationships on the subnet and network models (respectively)
to use subqueries as well.
On my dev environment after running the script in the report,
a network list took 5 minutes. Converting just the rbac_entries
or just the network/subnet relationship to subqueries reduced it
to 3-5 seconds. Converting both (as this patch does), reduces it
back down to a couple of hundred milliseconds (normal perf of my
development env with the current network count).
Subqueries will just cost us a constant number of queries and
won't scale up with result count so this should not impact scalability
in any way.
None of these fields are queryable from the API, so we don't need
to worry about breaking queries against the models.
Reviewed: https:/ /review. openstack. org/409901 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=a802b382d33 1423bf3449665dc fa7c48d7b8e094
Committed: https:/
Submitter: Jenkins
Branch: master
commit a802b382d331423 bf3449665dcfa7c 48d7b8e094
Author: Kevin Benton <email address hidden>
Date: Mon Dec 12 11:36:51 2016 -0800
Use subqueries for rbac_entries and subnets<->network
Loading subnets as part of the networks list and networks
as part of the subnets list appears to have a significant
impact when the network has tags and the subnets have
extra routes entries. This is even further compounded by
the network having rbac entries (likely due to the subnet
inheriting the RBAC entries of the network with the custom
join condition in the model).
This patch converts rbac_entries on both subnet and network
to use a subquery and converts the network and subnets
relationships on the subnet and network models (respectively)
to use subqueries as well.
On my dev environment after running the script in the report,
a network list took 5 minutes. Converting just the rbac_entries
or just the network/subnet relationship to subqueries reduced it
to 3-5 seconds. Converting both (as this patch does), reduces it
back down to a couple of hundred milliseconds (normal perf of my
development env with the current network count).
Subqueries will just cost us a constant number of queries and
won't scale up with result count so this should not impact scalability
in any way.
None of these fields are queryable from the API, so we don't need
to worry about breaking queries against the models.
Partial-Bug: #1649317 79b21344b10cb7a b0e573e419f
Change-Id: Ic1947e3d78d58a