What determines how fast or slow my Retool app runs? Basic queries on the Retool database take forever sometimes

Basically the subject. I use the Retool database right now but I find the performance is completely random.

For example, I have on my UI a button that when pressed, unhides a container and scrolls down to it. Super basic, and typically it runs within a second or so of pressing the button, but once in a while, like right now, it takes 15 seconds before it does anything.

Same with queries. I have a simple query like this on the Retool database, that returns 5 rows only:

FROM rpa_internet_am
WHERE type LIKE 'rbi' AND status = 'active'
ORDER BY discounted_msf ASC;

Yet it often takes 13-15 seconds to run. You press the button in the UI and it says "running query" at the bottom and counts up to almost 15 seconds. It's not always, but it definitely does happen to the point it feels like the app is frozen if it wasn't for the "running query" on the bottom.

Should I be looking at self hosted perhaps, or my own SQL database to improve performance, or would it basically be the same thing?

Hi @lmonroe - Thanks for flagging this! When you look in the code section you should be able to see some more data around the runtime for a specific query. Are you able to share a screenshot of what you see like so:

Screenshot 2023-10-23 at 17.18.11

I'm also including a link to our best practices guide here which has some additional suggestions for improving performance.