Best practice when loading apps etc

Hello,

I've been getting to grips with Retool since December. I'm not a coder by any stretch, and in that same time I have had to get my head around Postgres and AWS. I understand the fundamentals of relational database design.

I wanted to know, are there any best practices when it comes to loading apps? I ask - because, I have a simple form/app (See below) but that form is made up of three queries - nothing too complicated, just pulling some data for a few lookups, and a table.

Then, based on the table - populates another table.

My database only has 80 records - and I already see it's a bit slow pulling this (small loading circle) quite a lot on this main page /app (first image below)

So I'm guessing that due to my lack of knowledge in general on databases, and my inexperience of retool - there is probably a really efficient way, or some best practice to follow.

So I just wanted to hear your thoughts so I can start as I mean to go on.

Some things that come to my mind:

  • Can I load a query when a tabbed container moves for example, or, when a modal box opens.... rather than 'loading 'all the time'. I did experiment with 'only when triggered' but then i wasn't able to trigger in a way tat was user friendly.
  • Should lI load one big query and populate all drop-downs on page vs smaller simple ones
  • Should I create a view in my postgres db and then just pull everything from there?

That kind of thing. I know these are not necessarily just retool questions but perhaps fundamentals of querying etc, but it is all fairly new to me.

Some insights in the images below... the first image is the slowest of the two apps.....

Hope to hear,
Neil


1 Like

Hey @maillme!

To start, we do have this doc on performance best practices: https://docs.retool.com/docs/app-performance-best-practices

And to answer your specific questions,

  • Can I load a query when a tabbed container moves for example, or, when a modal box opens.... rather than 'loading 'all the time'. I did experiment with 'only when triggered' but then i wasn't able to trigger in a way tat was user friendly.
  • > Yes! Let me know if something like this would be helpful: http://community.retool.com/t/run-query-on-container-tab-select-option/3986/9
  • Should lI load one big query and populate all drop-downs on page vs smaller simple ones
  • > If the net data coming into your app is the same, I think smaller queries might perform better since you're not stuck waiting for the big query to finish. Not entirely sure, but that's what I'd suspect!
  • Should I create a view in my postgres db and then just pull everything from there?
  • > Hmmm. How much data are we talking? :sweat_smile:

Thanks Victoria,
I will be sure to check out those resources. It sounds like what I need.

On the queries /data - actually, it's not a very complicated database at all.... right now, not many records, but through time /years it could be in the hundreds of records for one of my queries.....

And one table will have tens of thousands, but, again, it's not very complicated the data.
The table with thousands will immediately be cut down to about 20 or so - when the query does it's job (although - maybe that's a lot of work, i really don't know haha).

thanks again,
Neil

In that case, I think things like simple queries and pagination would probably be enough :slight_smile: Definitely let us know if you feel things slowing down at all. Always happy to help!