Hello ReTool Community,
I am exploring the internal database option (RetoolDB) for a project and have a few questions regarding its capabilities for custom database management. Specifically, I would like to know:
-
Indexing: Does RetoolDB support the creation and management of custom indexes to optimize query performance?
-
Establishing Relations: Is it possible to define and manage relationships between tables within RetoolDB, similar to how foreign key constraints work in traditional relational databases?
-
Performance Optimization: Are there built-in tools or best practices within RetoolDB for optimizing database performance, especially for large datasets?
Any insights, documentation references, or best practices would be greatly appreciated!
Thank you!
Iterate through data with the Loop block
Hi @lenoradgray,
Responding to 2 and 3:
Yes, it is possible to establish foreign key constraints between tables and quite intuitive to do so.
Regarding performance, it really depends on the apps you will be building and the amount of data that you will be querying. Here's a good post around this topic.
From my experience, the retool database would start having perfromance issues with queries returning a couple of hundred lines. I reached out to the support team and they said, among other things:
..keep in mind that Retool DB is a free-tier serverless DB product, and the performance will reflect that. It is useful for prototyping and building an MVP but is not currently recommended if you are looking for high performance. I expect you can significantly improve query performance by using your own cloud hosted DB with a powerful instance...
After that I moved to Supabase and I saw a big improvement in performance compared to the retool database.
1 Like
Hey @lenoradgray,
Primary keys are indexed by default, but custom indexing is not supported. Some other options are to utilize query caching and read through our docs on improving query performance.