From d4b4fcf6e464ea349aa9914d327e582cff9509df Mon Sep 17 00:00:00 2001 From: Nikola Dipanov Date: Wed, 12 Jun 2013 14:42:58 +0200 Subject: Improve the performance of migration 186 This patch significantly improves the performance of migration 186 by refactoring the migration code to use SQL joins. It does in no way functionally change what the migration does. It also adds a more robust test to make sure that there were no regressions. Change-Id: I654ed8dd229d774e8f680cae2b8d2ad2cf28550c --- nova/tests/db/test_migrations.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nova/tests') diff --git a/nova/tests/db/test_migrations.py b/nova/tests/db/test_migrations.py index c73093d7d..e4e3be6f6 100644 --- a/nova/tests/db/test_migrations.py +++ b/nova/tests/db/test_migrations.py @@ -1520,6 +1520,10 @@ class TestNovaMigrations(BaseMigrationTestCase, CommonTestsMixIn): for q in instance_qs ) + self.assertEqual(len(bdm_1s), 3) + self.assertEqual(len(bdm_2s), 2) + self.assertEqual(len(bdm_3s), 4) + # Instance 1 self.assertEqual(bdm_1s[0].source_type, 'volume') self.assertEqual(bdm_1s[0].destination_type, 'volume') -- cgit