]> 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 <kevinbenton@buttewifi.com>
Wed, 22 Oct 2014 09:46:45 +0000 (09:46 +0000)
commitc14b58b1f8ba2f87c717441cdfca1c4c1be2f050
tree19d89e271e7beb48b5055c42af71f778aabb673e
parent830142e6923ff5fa8303afc22b0b61c39a374fe8
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
(cherry picked from commit 04df85b6e5a098f8f55bb82f04d9769763beb487)
neutron/db/securitygroups_rpc_base.py