Back

Query optimization of related field

  • 0
  • Self Hosted
  • Databases
  • Web
  • Cloud
Suiii
2 Sep, 2024, 06:51

I have client collection and I have many other collections are linked.

=> let me bring up one example, clientFollowUps.

clientFollowUps contains followUpId, clientId, notes. I then queries clientFollowUps collections.

I can get list (many many), I want to response to page to display like (FollowUpId, ClientName, Notes)

this case, when I get response clientFollowUps (let says 100 documents). then, I need to loop everysingle of them then try to getClient(clientId). If I consider using Cloud, it would be performance issue!

How can I manage to reduce the request to appwrite for somemthing like this.

It would less considerate for self-hosted, but If I prefer to use cloud. this is wasted requrests!

TL;DR
Developers need help optimizing queries for related fields in their collections to reduce the number of requests made when displaying data. This can lead to performance issues, especially when using Cloud services. One solution could be to utilize a join operation or aggregation framework to minimize the number of requests made to retrieve related data and display it more efficiently.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more