no any index for port DB sqlalchemy

Bug #1421089 reported by shihanzhang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
shihanzhang

Bug Description

Now there is not any index for port DB sqlalchemy, but for nova bulk create VM, it frequently select port according to 'tenant_id','network_id' ,'device_id', if no index, it will consume much time in db operation, so I think it is better to add index for
port 'tenant_id', 'network_id' ,'device_id'.

'tenant_id' is added in https://bugs.launchpad.net/neutron/+bug/1419815.

Tags: db
Changed in neutron:
assignee: nobody → shihanzhang (shihanzhang)
Revision history for this message
Ann Taraday (akamyshnikova) wrote :

Index for tenant_id is already added in https://bugs.launchpad.net/neutron/+bug/1419815.

tags: added: db
Revision history for this message
Ann Taraday (akamyshnikova) wrote :

Also I suggest to provide some examples that adding index really will speed up requests.

Changed in neutron:
status: New → Incomplete
Revision history for this message
shihanzhang (shihanzhang) wrote :

hi Ann Kamyshnikova, thanks for your response, I will add examples and remove 'tenant_id' in my patch!

Changed in neutron:
status: Incomplete → New
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
status: New → In Progress
Kyle Mestery (mestery)
Changed in neutron:
milestone: none → kilo-rc1
importance: Undecided → High
Revision history for this message
Henry Gessau (gessau) wrote :

See attached image.

blue line means: no index
read line means: tenant_id + device_id
green line means: tenant_id + device_id + network_id + mac_address
purple line means: tenant_id + device_id + network_id + mac_address + device_owner

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

Reviewed: https://review.openstack.org/169641
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=f93007952e40a7ae7cb2d4f3588059acf42ea209
Submitter: Jenkins
Branch: master

commit f93007952e40a7ae7cb2d4f3588059acf42ea209
Author: shihanzhang <email address hidden>
Date: Tue Mar 31 16:14:12 2015 +0800

    Add index for port

    This patch will speed up SELECTs Port with filters by
    'network_id + device_owner' and 'network_id + mac_address'.

    Closes-bug: #1421089

    Change-Id: Ied90b6304df971a6049871f65df3e1aaee624647

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-rc1 → 2015.1.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (neutron-pecan)

Fix proposed to branch: neutron-pecan
Review: https://review.openstack.org/185072

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.