Comment 28 for bug 1306743

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/90002
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=7ed7031466cd77e4568de9f5ab0cee9cc5afafb8
Submitter: Jenkins
Branch: master

commit 7ed7031466cd77e4568de9f5ab0cee9cc5afafb8
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 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

    Change-Id: I80be5d3de8744813d974f2e9860c148ad258f385