We're updating the issue view to help you get more done. 

Add index on snapshot_id to oc_assets_asset

Description

Queries like this are relatively slow:

SELECT t0.id, t0.checksum, t0.mediapackage_element_id, t0.mime_type, t0.size, t0.snapshot_id, t0.storage_id, t1.availability, t1.organization_id FROM oc_assets_asset t0 LEFT OUTER JOIN oc_assets_snapshot t1 ON (t1.id = t0.snapshot_id) WHERE (((t1.mediapackage_id = '1f089f45-1790-441d-a96e-322566c20033') AND (t0.mediapackage_element_id = 'security-policy-series')) AND (t1.version = 3)) ORDER BY t1.version DESC;

because of a missing index on snapshot_id. To fix:

CREATE INDEX IX_oc_assets_asset_snapshot_id ON oc_assets_asset (snapshot_id);

Steps to reproduce

None

Status

Assignee

Unassigned

Reporter

Stephen Marquard

Criticality

None

Tags (folksonomy)

None

Components

Fix versions

Affects versions

6.1

Priority

Major