[Cod-bugs] Slow queries through OPTIMADE API

Oier Arcelus oarcelus at cicenergigune.com
Thu Dec 2 17:05:27 EET 2021


Hi,

As a continuation of my previous question about the URL parameters on the 'next' links, I followed the workaround of Saulius Grazulis and add the URL parameters manually to the 'next' URL. And it worked.

However now I am finding that COD takes very long to generate a response from the queries I am making. I posted the doubts in https://matsci.org/t/connection-to-cod-optimade-api-is-very-slow/39556/11 and there was some discussion, but finally the suggestion was to contact this email directly. Basically, the doubt is if including response_fields that require returning the 'P1'-d cell take longer to generate. I did some small tests with different queries that I re-post here in case.


Queries with response_fields and nelements

https://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20"Li")%20AND%20(nelements=3)&response_fields=lattice_vectors,cartesian_site_positions,species,species_at_sites<https://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20%22Li%22)%20AND%20(nelements=3)&response_fields=lattice_vectors,cartesian_site_positions,species,species_at_sites> (3,8 sec)
http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20"Li",%20"Co")%20AND%20(nelements=3)&response_fields=lattice_vectors,cartesian_site_positions,species,species_at_sites<http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20%22Li%22,%20%22Co%22)%20AND%20(nelements=3)&response_fields=lattice_vectors,cartesian_site_positions,species,species_at_sites> (1min)
http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20"Li",%20"Co",%20"O")%20AND%20(nelements=3)&response_fields=lattice_vectors,cartesian_site_positions,species,species_at_sites<http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20%22Li%22,%20%22Co%22,%20%22O%22)%20AND%20(nelements=3)&response_fields=lattice_vectors,cartesian_site_positions,species,species_at_sites> (1min5sec)

Queries with only response_fields

http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20"Li")&response_fields=lattice_vectors,cartesian_site_positions,species,species_at_sites<http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20%22Li%22)&response_fields=lattice_vectors,cartesian_site_positions,species,species_at_sites> (7.2 sec)
http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20"Li","Co")&response_fields=lattice_vectors,cartesian_site_positions,species,species_at_sites<http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20%22Li%22,%22Co%22)&response_fields=lattice_vectors,cartesian_site_positions,species,species_at_sites> (1min14sec)
http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20"Li","Co","O")&response_fields=lattice_vectors,cartesian_site_positions,species,species_at_sites<http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20%22Li%22,%22Co%22,%22O%22)&response_fields=lattice_vectors,cartesian_site_positions,species,species_at_sites> (1min11sec)

Queries without any of the former

http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20"Li")<http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20%22Li%22)> (1sec)
http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20"Li","Co")<http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20%22Li%22,%22Co%22)> (1sec)
http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20"Li","Co",%20"O")<http://www.crystallography.net/cod/optimade/v1/structures?filter=(elements%20HAS%20%20ALL%20%22Li%22,%22Co%22,%20%22O%22)> (1,1sec)



You can see that querying for more elements in the compositions takes much longer, with little difference on wether I ask for a limited nelements or no.



Is there a specific reason behind this?



Best regards,



Oier.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.crystallography.net/pipermail/cod-bugs/attachments/20211202/398dddd7/attachment.htm>


More information about the Cod-bugs mailing list