Timeout vs Query Costs

Considering that the query cost calculation method exposed at the conference “GraphQL in Space”, I understand it is better to group the biggest amount possible of registers touched in one single query.

Meaning, 5 queries that touch 100 registers each will cost me 5 query credits in total, but a query that touches 500 registers will cost me 1 credit only. Is that right?

Having that said, I have also to consider that a query that is way too big may give me a timeout error.

Please confirm that the logic above is correct and also what is the timeout I can consider as a limit from the server when I calculate my optimal sized batch.

Thanks!

You’re correct in your analysis. We typically timeout queries which run for a minute. Though, there’re other limits like how much memory does a query take to return all the results – some queries we see return billions of records, and if they exceed 4GB in memory during encoding, we’d return an error instead.

So, you can try and push the limits, but stay on the safer side would be my recommendation.

2 Likes