Query Loads super slow (from AWS)

Hi all,

Hop ing you can help. I've set up a postgres db with AWS and linked it to my retool account. When I load a query, the run time is super slow. However when I run exactly the same query using pgAdmin4, the runtime is quick.

For example
Query loaded in retool app using AWS resource connection: 1.873s
Same query loaded using pgAdmin4 = 142 ms

I've created a new (empty) app and run the query from there so I know it's not anything to do with the app. I read somewhere the retool's processing adds c. 150ms to a query so would expect it to be around 300 ms / 0.3 secs.

I assume it's something to do with the connection. Any ideas please on how to improve?

Many thanks!


1 Like

Hi TimC welcome to the Retool Community Forum!

I see you are having some issues with latency. It would helpful for us to have a bit more context on this issue and to also double check a few key things.

  1. Can you ensure that both retool and pgAdmin4 are accessing the PostgreSQL instance in the same AWS region. Latency can increase if the tools are connecting from different regions, affecting query performance.
  2. Check if there are any network-related issues such as firewall rules or routing configurations that could impact the connection between retool and AWS PostgreSQL.

Once you can confirm these, can you possibly write out your query so that we can also check to see if it is written in the most optimal way? These are just a few things to help us get started!