Fix timeline endpoint
GET /catalogue/{sessionId}/dataset/timeline?investigationId=1298975507
is very slow for non admin users.
Current query is:
select dataset.startDate, dataset.endDate, investigation.id, investigation.name, dataset.name, dataset.id, sample.name, sample.id, parameterType.name, parameter.stringValue, datasetType.name
from DatasetParameter parameter
JOIN parameter.dataset dataset JOIN dataset.type datasetType JOIN dataset.investigation investigation, dataset.sample sample JOIN parameter.type parameterType
WHERE investigation.id = '1758664838' AND (parameterType.name = 'definition' or parameterType.name = '__fileCount' or parameterType.name = '__volume' or parameterType.name = '__elapsedTime')
This one is very fast:
select parameter
from DatasetParameter parameter
JOIN parameter.dataset dataset JOIN dataset.type datasetType JOIN dataset.investigation investigation, dataset.sample sample JOIN parameter.type parameterType
WHERE investigation.id = '1758664838' AND parameterType.name in ('definition', '__fileCount', '__volume', '__elapsedTime')