Why are SQL queries so much slower when executed through retool vs executing directly?

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?