The ShareInstance model has relationships with AvailabilityZone and
ShareType models. These relationships are loaded lazily by subquery.
This emits sql queries for availability zone and share type with
subquery for all share instances, which is not efficient as the share
instance table grows. This change modifies the relationships to load the
availability zone and share type with selectin load, which will load all
items from the availability zone and share type tables in a single
query. It's acceptable because they are pretty small tables.
modified another lazy loading, for relationship between share and share instance. It's frequently used in the share/details API. This should give noticeable performance improvement.
The ShareInstance model has relationships with AvailabilityZone and ShareType models. These relationships are loaded lazily by subquery. This emits sql queries for availability zone and share type with subquery for all share instances, which is not efficient as the share instance table grows. This change modifies the relationships to load the availability zone and share type with selectin load, which will load all items from the availability zone and share type tables in a single query. It's acceptable because they are pretty small tables.
Reference for selectin loading: link
Change-Id: I0525b8cff6616e4e6f290de50dcdd50e1b7435d8