Index on maasserver_routable_pairs would improve performance
Bug #1702669 reported by
Mark Shuttleworth
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Mike Pontillo | ||
2.2 |
Won't Fix
|
Medium
|
Mike Pontillo |
Bug Description
I am watching postgres logs for slow queries and noticed a lot of these:
2017-07-06 12:21:08 BST [67989-13] maas@maasdb LOG: duration: 51.371 ms statement: SELECT left_node_id, left_ip,
FROM maasserver_
WHERE left_node_id IN (236)
AND right_node_id IN (1)
ORDER BY metric ASC
That's a very simple query on a single flat table, it should be fast. Adding an index on (left_node_id, right_node_id) would address that.
Related branches
~mpontillo/maas:backport-index-on-ip-family--2.2
- Mike Pontillo (community): Approve
-
Diff: 27 lines (+21/-0)1 file modifiedsrc/maasserver/migrations/builtin/maasserver/0124_staticipaddress_address_family_index.py (+21/-0)
~mpontillo/maas:add-ip-address-family-index
Merged
into
maas:master
- Blake Rouse (community): Approve
-
Diff: 27 lines (+21/-0)1 file modifiedsrc/maasserver/migrations/builtin/maasserver/0124_staticipaddress_address_family_index.py (+21/-0)
Changed in maas: | |
importance: | Undecided → High |
status: | New → Triaged |
milestone: | none → 2.3.0 |
tags: | added: performance |
Changed in maas: | |
assignee: | nobody → Mike Pontillo (mpontillo) |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
milestone: | 2.3.0 → 2.3.0alpha1 |
Changed in maas: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Turns out maasserver_ routable_ pairs is a view not a table. Have we explored a materialized view for this? That would be indexable.