]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Improve performance of security group DB query
authorKevin Benton <blak111@gmail.com>
Wed, 24 Sep 2014 12:23:32 +0000 (05:23 -0700)
committerKevin Benton <blak111@gmail.com>
Sat, 18 Oct 2014 02:59:02 +0000 (19:59 -0700)
commit04df85b6e5a098f8f55bb82f04d9769763beb487
treec8415820ad676c39856e37edd5b743295db65a50
parent1aaa8b34466b0567c6a5ea0b607f1ac324ee5dfa
Improve performance of security group DB query

The _select_ips_for_remote_group method was joining the
IP allocation, port, allowed address pair, and security group tables
together in a single query. Additionally, it was loading all of
the port columns and using none of them. This resulted in a
very expensive query with no benefit.

This patch eliminates the unnecessary use of the port table by joining
the IP allocation table directly to the security groups and allowed
address pairs tables. In local testing of the method, this sped it up
by an order of magnitude.

Closes-Bug: #1373851
Change-Id: I12899413004838d2d22b691f1e2f3b18f7ec2c27
neutron/db/securitygroups_rpc_base.py