← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1287077] Re: Optimize the use of sqlalchemy's query

 

There is no difference between old and new ones. The actual query is not
issued until the query is requred (e.g., all(), one() or iterator
access). You can confirm what happens by using echo=True.

** Changed in: neutron
       Status: In Progress => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1287077

Title:
  Optimize the use of sqlalchemy's query

Status in OpenStack Neutron (virtual network service):
  Invalid

Bug description:
  In some use, the filter is separated from query witch will affect the
  efficiency of the query.

  such as:
  rport_qry = context.session.query(models_v2.Port)
  rports = rport_qry.filter_by(device_id=router_id)
  There will do as two steps:
  1, select * from table
  2, filter the query result

  but rports = context.session.query(models_v2.Port).filter_by(device_id=router_id)
  just do one step:
  select * from table where device_id=router_id

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1287077/+subscriptions


References