Database query timeout not changing

I've been trying to query my cloud database. The query execution time is generally between 12 and 20 seconds. I tried increasing the timeout from 10,000ms to 120,000ms both at the "Query library" level and on the "Advanced tab" of the query itself. The query still times out after 10 seconds. Is there some other way to set the timeout?

Also, when this didn't work, I tried reducing from 120 seconds to 119 seconds (since your documented maximum is 120 seconds, I thought I'd put in a little leeway).

@SunilDe just in case this helps, wanted to share this post about 4 places timeouts may be set (note numbers 2 and 3 are specific to self-hosted instances of Retool. Could it be possible that there's a timeout setting on your database level, outside of Retool? :thinking: What kind of resource are you querying?

Hi @kbn ,
As I'd mentioned in my post, I've tried setting the timeout on the Query in the app (Advanced), the library that the query references. My Azure Postgresql database is set up with timeouts disabled - I've run queries that take upwards of a minute on it through a DB client.
Any access to this database that takes more than 10 seconds times out.

@SunilDe Can you share some other details.

  1. Are you on a self hosted Retool instance, or using Retool on cloud? (if self hosted, deployment details would be great).

  2. Any access to this database that takes more than 10 seconds times out.

  • Are all of these queries imported from the Query Library? Or are you noticing that queries defined in apps are also timing out at 10s?

Hi Joe,
I'm using Retool on cloud.
Accessing the DB with my current client (TablePlus) or through Google Sheets (apps script) works just fine with query times going well over a minute at times.

The query that's giving me problems is in the query library. It involves a dynamically generated list, so on use, it inserts a string to complete the query (and I've enabled "Disable converting queries to prepared statements").

It seems to be moody though. Sometimes It runs the query (when it takes 12-16 seconds) and sometimes it times out after 10 seconds. Once it starts (or stops) working, it works (or stops working) for a day or more.

I don't have any other queries that would take much time (most of them get handled in ms rather than seconds), so can't test to see if it happens with any other external access.