Very slow to retrieve datasets for users
This approach:
SELECT dataset.id, dataset.name, dataset.startDate, dataset.endDate, investigation.name, parameterType.name, parameter.stringValue, parameter.numericValue, dataset.location, investigation.id, investigation.summary, investigation.visitId, sample.name FROM DatasetParameter as parameter JOIN parameter.dataset dataset JOIN parameter.type parameterType JOIN dataset.sample sample JOIN dataset.investigation investigation where investigation.id =:investigationId
and this:
exports.getDatasetsByInvestigationId = (sessionId, investigationId, onSucess, onError) => {
function onGetIdSuccess(response){
if (response.length > 0){
console.log("Retrieving....")
console.log(icatQuery.getDatasetsByDatasetIds(sessionId, response.slice(0, 700)))
doGet(
icatQuery.getDatasetsByDatasetIds(sessionId, response.slice(0, 700)),
successParsing,
onError);
}
else{
onSucess([]);
}
}
function successParsing(response) {
try{
var investigation = cache.getInvestigationById(sessionId, investigationId);
onSucess(datasetParser.parse(response, investigation));
}
catch(e){
global.gLogger.error(e);
onError(e);
}
}
function onError(response) {
console.log(response)
onError(response);
}
global.gLogger.info(icatQuery.getDatasetsByInvestigationId(sessionId, investigationId));
doGet(
icatQuery.getDatasetIdsByInvestigationId(sessionId, investigationId),
onGetIdSuccess,
onError);
};
are very slow.
Trying:
https://icat.esrf.fr/icat/entityManager?sessionId=9d0fac67-cedc-4da3-a934-53e1f2052c8c&query=SELECT dataset FROM Dataset dataset JOIN dataset.investigation investigation where investigation.id =127495001 INCLUDE dataset.investigation investigation, dataset.parameters parameters, parameters.type