network_get_all_by_host query fails to use index

Bug #1369009 reported by Vish Ishaya
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Vish Ishaya

Bug Description

The get_networks_by_host query fails to use the existing indexes on fixed ips. This means a large number of fixed_ips can lead to the database getting bogged down and taking multiple seconds to return.

Changed in nova:
status: New → In Progress
assignee: nobody → Vish Ishaya (vishvananda)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

summary: - Get networks by host query fails to use index
+ network_get_all_by_host query fails to use index
tags: added: icehouse-backport-potential
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/121276
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=64b2aa71d90f15bc5f0a27ae6534515f2ac1309d
Submitter: Jenkins
Branch: master

commit 64b2aa71d90f15bc5f0a27ae6534515f2ac1309d
Author: Vishvananda Ishaya <email address hidden>
Date: Fri Sep 12 17:29:42 2014 -0700

    Fixes network_get_all_by_host to use indexes

    The OR in the subquery was constructed in a way that didn't allow
    the fixed_ips without instances allocated to be filtered out. It
    also had an unnecessary join through virtual interfaces. We have a
    denormalized field for instance_uuid with an index in the fixed_ips
    table that we can use. This patch removes the unnecessary join and
    ads an extra filter inside the OR to reject fixed_ips without
    instances. In my test with 300000 fixed ips, this reduced the query
    time from about 2.5 seconds to less than 0.01 seconds.

    Change-Id: I26fb0dfaf5ff64bd70c947982de4ec1728c84856
    Resolves-bug: #1369009

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-rc1 → 2014.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.