Add useful indexes for performance as part of Distil migrations

Registered by Adrian Turjak

Distil should create it's own indexes for certain tables (notably usage_entry) to optimise against the very specific queries that we do against the database when using the service APIs.

In Alembic that is done via:
http://alembic.zzzcomputing.com/en/latest/ops.html?highlight=index#alembic.operations.Operations.create_index

One useful index in particular is:
op.create_index('usage_entry_tenant_start_end', 'usage_entry', ['tenant_id', 'start', 'end'])

As part of this blueprint we should ideally also investigate our other queries and see if any other indexes might also be useful.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Adrian Turjak
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.