yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #42843
[Bug 1174192] Re: Provide a way to load related collections using joins
[Expired for neutron because there has been no activity for 60 days.]
** Changed in: neutron
Status: Incomplete => Expired
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1174192
Title:
Provide a way to load related collections using joins
Status in neutron:
Expired
Bug description:
It is a common pattern in our code to retrieve a collection using a
model specific method (e. g. get_networks()/get_subnets()/etc) and
process its elements in for loop. However this is not very database
friendly if the model has related collections that are lazy loaded
(i. e. they are loaded by making an additional select query on
attribute access), because this leads to (1 + N) queries to DB.
We can actually analyze the list of queried fields and force
loading of related collection using LEFT OUTER JOIN. This makes
the original query more complex but prevents us from making of
additional N queries.
The idea is to modify generic _get_collection() method so that
a caller may force it to use 'joinedload' strategy in different
ways: use 'joinedload' for loading of specified related collections,
use 'joinedload' for loading of all related collections that
are queried, disable 'joinedload' and load related collections lazily
on attribute access.
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1174192/+subscriptions