Merge ~mpontillo/maas:backport-index-on-ip-family--2.2 into maas:2.2

Proposed by Mike Pontillo
Status: Rejected
Rejected by: Mike Pontillo
Proposed branch: ~mpontillo/maas:backport-index-on-ip-family--2.2
Merge into: maas:2.2
Diff against target: 27 lines (+21/-0)
1 file modified
src/maasserver/migrations/builtin/maasserver/0124_staticipaddress_address_family_index.py (+21/-0)
Reviewer Review Type Date Requested Status
Mike Pontillo (community) Approve
Review via email: mp+327132@code.launchpad.net

Commit message

Add index on family(ip) for each StaticIPAddress.

 * This change greatly improves the execution time of the
   maasserver_routable_pairs view.

LP: #1702669

Backports revision c02824b to MAAS 2.2.

To post a comment you must log in.
Revision history for this message
Mike Pontillo (mpontillo) wrote :

Self-approve backport.

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

LANDING
-b backport-index-on-ip-family--2.2 lp:~mpontillo/maas into -b 2.2 lp:~maas-committers/maas

STATUS: FAILED BUILD
LOG: http://ci-maas-jenkins.internal:8080/job/maas/job/branch-tester/78/console

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Let's make sure we test the upgrade path both from 2.1 and to 2.3.

On Mon, Jul 10, 2017 at 1:44 PM MAAS Lander <email address hidden>
wrote:

> The proposal to merge ~mpontillo/maas:backport-index-on-ip-family--2.2
> into maas:2.2 has been updated.
>
> Status: Approved => Needs review
>
> For more details, see:
> https://code.launchpad.net/~mpontillo/maas/+git/maas/+merge/327132
> --
> Your team MAAS Committers is subscribed to branch maas:2.2.
>
--
Andres Rodriguez (RoAkSoAx)
Ubuntu Server Developer
MSc. Telecom & Networking
Systems Engineer

Revision history for this message
Mike Pontillo (mpontillo) wrote :

No need. This cannot land in 2.2 because a 2.3-only migration has already landed, which I didn't notice when I looked earlier:

    0123_make_iprange_comment_default_to_empty_string

So unless we reorder migrations on trunk, we're done with this.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Since we have not released alpha1, nor we have that many migrations, should
we just re-generate the 2.3 migration ?

On Mon, Jul 10, 2017 at 2:45 PM, Mike Pontillo <email address hidden>
wrote:

> No need. This cannot land in 2.2 because a 2.3-only migration has already
> landed, which I didn't notice when I looked earlier:
>
> 0123_make_iprange_comment_default_to_empty_string
>
> So unless we reorder migrations on trunk, we're done with this.
> --
> https://code.launchpad.net/~mpontillo/maas/+git/maas/+merge/327132
> Your team MAAS Committers is subscribed to branch maas:2.2.
>

--
Andres Rodriguez
Engineering Manager, MAAS
Canonical USA, Inc.

Revision history for this message
Mike Pontillo (mpontillo) wrote :

As discussed on IRC, we could, at the risk of breaking the edge snap (and confusing anyone developing MAAS and tracking the latest trunk).

But it's unclear to me if it's worth the effort to that, as this seems to be a minor performance enhancement with an easy workaround.

Unmerged commits

c02824b... by Mike Pontillo

Add index on family(ip) for each StaticIPAddress.

 * This change greatly improves the execution time of the
   maasserver_routable_pairs view.

LP: #1702669

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maasserver/migrations/builtin/maasserver/0124_staticipaddress_address_family_index.py b/src/maasserver/migrations/builtin/maasserver/0124_staticipaddress_address_family_index.py
2new file mode 100644
3index 0000000..64c4f85
4--- /dev/null
5+++ b/src/maasserver/migrations/builtin/maasserver/0124_staticipaddress_address_family_index.py
6@@ -0,0 +1,21 @@
7+# -*- coding: utf-8 -*-
8+from __future__ import unicode_literals
9+
10+from django.db import (
11+ migrations,
12+ models,
13+)
14+
15+
16+class Migration(migrations.Migration):
17+
18+ dependencies = [
19+ ('maasserver', '0123_make_iprange_comment_default_to_empty_string'),
20+ ]
21+
22+ operations = [
23+ migrations.RunSQL(
24+ "CREATE INDEX maasserver_staticipaddress__ip_family ON maasserver_staticipaddress (family(ip))",
25+ "DROP INDEX maasserver_staticipaddress__ip_family"
26+ )
27+ ]

Subscribers

People subscribed via source and target branches