Set loading strategy to joined for Routerport/Port
The RouterPort model has a relationship to the ports model which
is frequently relied on to get the port IDs of interfaces attached
to a router. However, this defaults to the loading strategy to
'select', which meant a new query was being emitted for every
interface to the ports table just to get the ID.
This patch adjusts the relationship to be 'joined' by default so
one query will fetch the related ports.
Another option would have been not to use the port object at all since
the ID is all that the callers were usually interested in. However,
they would end up using the ID to do a port lookup, which is being
optimized away in another patch anyway so the full port object from
the relationship will end up getting used.
Change-Id: Id1ae35f845f7367d5f1f065c6fa637da7b980a2b
Partial-Bug: #1445412
(cherry picked from commit 10b17a884452736a6b214bcb7705b955192a1748)
Reviewed: https:/ /review. openstack. org/175588 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=1a46332a466 1841d219888a4be c952d6f9859331
Committed: https:/
Submitter: Jenkins
Branch: stable/kilo
commit 1a46332a4661841 d219888a4bec952 d6f9859331
Author: Kevin Benton <email address hidden>
Date: Fri Apr 17 03:36:50 2015 -0700
Set loading strategy to joined for Routerport/Port
The RouterPort model has a relationship to the ports model which
is frequently relied on to get the port IDs of interfaces attached
to a router. However, this defaults to the loading strategy to
'select', which meant a new query was being emitted for every
interface to the ports table just to get the ID.
This patch adjusts the relationship to be 'joined' by default so
one query will fetch the related ports.
Another option would have been not to use the port object at all since
the ID is all that the callers were usually interested in. However,
they would end up using the ID to do a port lookup, which is being
optimized away in another patch anyway so the full port object from
the relationship will end up getting used.
Change-Id: Id1ae35f845f736 7d5f1f065c6fa63 7da7b980a2b a6b214bcb7705b9 55192a1748)
Partial-Bug: #1445412
(cherry picked from commit 10b17a884452736