Query timeout

So I’m trying to iterate thorough a collection to get the documents that satifies a certain condition, but I get a timeout very fast like after 4 seconds

Orders
  .firstWhere(x => x.source?.line_items?.tax_lines?.length > 1) {source {line_items}}

One thing to note is that the tax_lines field is not indexed and tax_lines is an array

I’m currently on the startup plan. I can see from the docs that there are throughput limits but no limit on total usage over a month. How do I debug this?

Hi Donny,

The default query timeout is only 5 seconds. If your query needs to run longer than that, then you can increase it.

This isn’t possible in the dashboard, but your driver client can be configured. Here is an example with the javascript driver,

// set query timeout to 20 seconds
const client = new Client({ query_timeout_ms: 20_000 });

You can read more about the driver configurations in the repository README: GitHub - fauna/fauna-js: FQL v10 Javascript Driver

Ok then it makes sense

But what is the rationale for only having 5 seconds limit in the dashboard? If I wanted to do a semi long query on an ad hoc basis, doing it in the dashboard is by far the easiest way possible.

To clarify, 5 seconds is the default query timeout for the v10 API, and was chosen after reviewing historical data. The dashboard doesn’t override it beyond that 5 seconds.

I’ve brought this up with our team working on the Dashboard, though. And regardless of the query time setting, I think we can make it clearer what limit is used and that it can be overridden as part of driver configuration.