SQLAlchemy Query can be used as an iterable to avoid creation of a list

Bug #1173133 reported by Roman Podoliaka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Wishlist
Roman Podoliaka

Bug Description

A Query.all() call creates a list of a DB query results. We can actually use a Query instance as an iterable and thus avoid creation of a list if we just need to iterate over those values only once.

Tags: db
Changed in quantum:
assignee: nobody → Roman Podolyaka (rpodolyaka)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/27556

Changed in quantum:
status: New → In Progress
Changed in quantum:
importance: Undecided → Wishlist
Changed in quantum:
milestone: none → havana-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/27556
Committed: http://github.com/openstack/quantum/commit/c7afedad00ea8a44770643c95714637ee8671000
Submitter: Jenkins
Branch: master

commit c7afedad00ea8a44770643c95714637ee8671000
Author: Roman Podolyaka <email address hidden>
Date: Thu Apr 25 16:15:59 2013 +0300

    Use Query instances as iterables when possible

    A Query.all() call creates a list of a DB query results.
    We can actually use a Query instance as an iterable and
    thus avoid creation of a list if we just need to iterate
    over those values only once.

    Fixes bug 1173133

    Change-Id: I06d8eaa9eaba4c71aa0c98000735cb9d83ea19a3

Changed in quantum:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in quantum:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: havana-1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.