Instead of calling resource_get_by_name_and_stack once for every
resource in the stack, db_api.resource_get_all_by_stack is called
only once for all resources.
This reduces the number of sql queries during a describe_stack_resource
call to 3:
1. load the stack
2. load the template
3. load the resources
This is a big improvement over the start of this patch series, which
is 2 queries plus:
* 1 per resource in the stack
* 1 per access to a resource metadata attribute
* 1 per access to a resource data value
There is probably still potential to reduce queries from 3, but this
may well be a fix for
Partial-Bug: 1306743
Reviewed: https:/ /review. openstack. org/90002 /git.openstack. org/cgit/ openstack/ heat/commit/ ?id=7ed7031466c d77e4568de9f5ab 0cee9cc5afafb8
Committed: https:/
Submitter: Jenkins
Branch: master
commit 7ed7031466cd77e 4568de9f5ab0cee 9cc5afafb8
Author: Steve Baker <email address hidden>
Date: Thu Apr 24 16:25:55 2014 +1200
Fetch all db resources in one query
Instead of calling resource_ get_by_ name_and_ stack once for every resource_ get_all_ by_stack is called
resource in the stack, db_api.
only once for all resources.
This reduces the number of sql queries during a describe_ stack_resource
call to 3:
1. load the stack
2. load the template
3. load the resources
This is a big improvement over the start of this patch series, which
is 2 queries plus:
* 1 per resource in the stack
* 1 per access to a resource metadata attribute
* 1 per access to a resource data value
There is probably still potential to reduce queries from 3, but this
may well be a fix for
Partial-Bug: 1306743
Change-Id: I80be5d3de87448 13d974f2e9860c1 48ad258f385