Speed up end point to retrieve datasets per DOI
eg. https://data.esrf.fr/public/10.15151/ESRF-DC-1160641667
Some changes have been done in the query with the re-factorization: Before
select distinct dataset from Dataset dataset JOIN dataset.dataCollectionDatasets dcds JOIN dcds.dataCollection dc JOIN dataset.investigation investigation JOIN dataset.sample sample JOIN dataset.parameters parameters JOIN parameters.type parameterType WHERE dc.doi = '10.15151/ESRF-DC-1160641667' order by dataset.startDate DESC include dataset.investigation investigation, investigation.investigationInstruments investigationInstruments, investigationInstruments.instrument instrument, dataset.parameters parameters, parameters.type, dataset.sample LIMIT 0, 10000
After
select distinct(dataset) from Dataset dataset JOIN dataset.investigation investigation JOIN dataset.type datasetType LEFT JOIN dataset.sample sample JOIN dataset.parameters parameters JOIN parameters.type parameterType JOIN investigation.investigationInstruments investigationInstruments JOIN investigationInstruments.instrument instrument LEFT JOIN dataset.dataCollectionDatasets dcds LEFT JOIN dcds.dataCollection dataCollection WHERE ( dataCollection.doi = '10.15151/ESRF-DC-1160641667' OR investigation.doi = '10.15151/ESRF-DC-1160641667' OR dataset.doi = '10.15151/ESRF-DC-1160641667' ) order by dataset.startDate DESC include dataset.type type, dataset.investigation investigation, investigation.investigationInstruments investigationInstruments, investigationInstruments.instrument instrument, dataset.parameters parameters, parameters.type, dataset.sample LIMIT 0, 10000