Run stored procedure using textinput box that times out

I had an experienced database person prepare a stored procedure for me that takes data from several source tables to build a report table. I built a prompt to enter a new client name that is used in the stored procedure.

The Run Stored Procedure button is tied to the following query.

Notice it indicates it timed out after 10 seconds. When I manually run the stored procedure through the database (outside of Retool), it runs properly (Query returned successfully in 48 secs 995 msec.), but takes nearly 49 seconds. Is there a way to grant more time for the stored procedure to run within Retool?

Hi @adrooney,

If you are running this query from the App directly (e.g. this is not a saved query) then in the 'Advanced' tab you will see a Timeout option.

However, it seems like there might be something else amiss because 10+ seconds to run a query is not expected (especially if you can run it locally very quickly)

Are you sure that your datasource is configured correctly and isn't being blocked by a firewall somewhere?

Thanks Ron. I should've thought to look around the query to see if I might find something. It works! What did you mean this is not a saved query? It does take 49 seconds from the Postgresql app and roughly the same time from within Retool. Do you still have concerns about firewall or anything else. It is running multiple select, insert and update SQL's. I put them in a stored procedure because I need to pass variables between SQL statements.


Glad its working. In Retool you can save queries as 'Saved Queries' so that you can reuse them throughout your apps without having to write the same SQL in each App.

Personally, I would not a query to run for longer than a few hundred milliseconds. I understand that with complex table architecture that may not always be possible. But that should be a goal IMO.

Thanks. I generally agree with you about long queries. In this case, it is a client onboarding process that doesn’t happen (so far) as frequently as other tasks a user might perform daily. It’s much faster than I can do it, more consistent improving accuracy and can be delegated to someone other than me.

1 Like