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.
Reviewed: https:/ /review. openstack. org/383542 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=145dbaab21c 7b541294869eec5 47731a9694cbad
Committed: https:/
Submitter: Jenkins
Branch: master
commit 145dbaab21c7b54 1294869eec54773 1a9694cbad
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 1e86b2fbd8aa895 578153f4cf9
Change-Id: I4364f4a97a2904