API-call resources slower then js-fetch

Hey there,
I am using the retool rest-api resources (eu-server) to connect to our supabase-db (eu-server) and it takes 4.5sec to fetch the 15+items. I also tried the postgres resources with similar times. And this stacks up the bigger the db is.
When using the js-connector & fetch, it takes 4-500ms (with visible credentials obviously).

Any idea how we can speed up the retool-resources further?

Hi @Dimitrios :wave:

After a Retool query has executed you can hover over the time to see an overview of the time spent on all different parts of the query.
Screenshot 2024-04-15 at 14.04.24

As you can see the Retool backend needs some time to transfer the data to your app, and that adds up pretty quickly. In my experience the more complex the structure of your data, the more time is added in the Retool backend.

Regardless of the above, I use the combo Supabase and Retool quite often and haven't experienced that much added time in the Retool backend. Do you trigger a lot of side effects after fetching the data that can possibly result in the slower response time?

Thanks for the feedback and tip, was not aware of the detailed view.
Currently the db has only 50 entries, but this should grow to 1000+.
they are not nested, just a simple table with 10+ properties. However, one of them is an img in base64 and the response is 12mb big. Same request in postman takes 600ms.

here for resources
and postgres
select * from template_dev

You're welcome!

I'm pretty sure the image is the culprit here and likely the cause of the slow response time.

Slightly off topic for a Retool forum, but have you considered using Supabase Storage to host the image? I'd suggest hosting the image in the Storage, and then save a reference to the image in your database. This will reduce the response size and in general make your queries more performant.