Hi @Nancy_Ts!
Apologies for the delay here!
I discussed your feedback with the engineers that own the Postgres integration, and it doesn't sound like this aligns with any recent changes. We haven't had a trend of similar reports of this issue, which makes me think it's not a regression within the Retool product . In regards to your original post, they did highlight that the query timeout setting on the query doesn't apply to the entire query time, but rather, only the actual time of the query. It does not include the time to acquire the connection which can take significant time.
I stepped into your app a couple of times, per your instructions, but I haven't been able to reproduce this issue on my side The queries are running relatively quickly & I don't see connection errors. It sounds like this is somewhat inconsistent behavior, which could be why it's difficult for me to repro.
I also discussed this with some teammates internally, and based on the behavior described here, the fact that it works sometimes, & the errors that you flagged in your direct message, it could be related to connection pool issues. We'd recommend looking into the connection pool settings on Postgres (outside of Retool). Is this something you've already looked into? For some additional context, Retool will create new connections for each instance of an app that is open, so if you the app open many times (or if many users have the same app opened), then this scenario would lead to many connections being opened. All these users will be connected to your database using the same DB user that is set up in your Retool account. There is a related discussion happening here. I found a stack overflow article that might be helpful as well.
Lastly, I don't think this fully encompasses the issue as you are seeing, but I still wanted to share for anyone else that comes across this post: one thing to be mindful of is where your data is hosted, as described in this post, the location can have a decent impact on query performance. Transfer data is dependent on the resource (size of data) and location (bandwidth, latency).
I'll keep looking into this a bit more, but I hope this helps!