Comment 16 for bug 1649317

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/newton)

Reviewed: https://review.openstack.org/413979
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=ff1d93db355730c84a4bcaff5dd0e10d6670667e
Submitter: Jenkins
Branch: stable/newton

commit ff1d93db355730c84a4bcaff5dd0e10d6670667e
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
    Change-Id: Ic1947e3d78d58a79b21344b10cb7ab0e573e419f
    (cherry picked from commit a802b382d331423bf3449665dcfa7c48d7b8e094)