Is anyone able to provide some guidance on what appears to be a truly extraordinary difference in PostgreSQL query response times when executing queries through Retool vs some other app (e.g. psql or in a jupyter notebook using pandas)? We have a query that takes ~30s to execute locally, and I haven't actually been able to get the query to complete using Retool - I've let it sit there for 5-10 minutes with no luck. Additionally, the query doesn't appear to respect Retool's timeout parameter, which perhaps suggests that the query itself is finishing its execution, but something on Retool's side is preventing a response from being returned in a timely manner. See the below screenshot for the a query exceeding the stated timeout:
HI @William_Hakim,
A while ago I exchanged a couple of emails with retool about their database, and the below extract may be of some insight:
..keep in mind that Retool DB is a free-tier serverless DB product, and the performance will reflect that. It is useful for prototyping and building an MVP but is not currently recommended if you are looking for high performance. I expect you can significantly improve query performance by using your own cloud hosted DB with a powerful instance...
@MiguelOrtiz I'm querying a PostgreSQL DB hosted in the cloud, which Retool is connected to. Not sure if that's your situation?
Hi @William_Hakim! Welcome to the community and thanks for reaching out. This response is a little belated, but I thought I'd hop in to provide some insight. ![]()
Connecting to any resource via Retool will generally be slower than connecting to it directly, simply because the request is routed through our backend servers. This shouldn't ever add more than ~500ms of latency, though, so the magnitude of the delay that you're describing is certainly unexpected.
It sounds to me like the request might be timing out due to a lack of authorization. Does the database that you're connecting to have an IP allowlist? If so, you may need to add the Retool addresses.
