Comment 5 for bug 1630939

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

Reviewed: https://review.openstack.org/383542
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=145dbaab21c7b541294869eec547731a9694cbad
Submitter: Jenkins
Branch: master

commit 145dbaab21c7b541294869eec547731a9694cbad
Author: Kevin Benton <email address hidden>
Date: Thu Oct 6 21:25:58 2016 -0700

    Get rid of double-join to rbac_entries without filter

    apply_filters_to_query was performing an outerjoin to rbac_entries
    unconditionally when model_query could have already performed an
    outerjoin (if the request was from an unprivileged user) and/or when
    the join wasn't even necessary (the '?shared=False' query that uses
    a subquery and not a join). This resulted in terrible performance
    because of cartesian products of rbac entries with themselves.

    This fixes the issue by ensuring there is only an outerjoin to the
    rbac table if it's going to be used for a filter condition and it's
    not already joined because of a query scope imposed due to the user
    not being privileged.

    Unfortunately this doesn't include tests to prevent regressions because
    we don't have any methods for testing the performance of individual
    queries.

    Closes-Bug: #1630939
    Change-Id: I4364f4a97a29041e86b2fbd8aa895578153f4cf9