mtamc / memo

Website for rating books, movies, video games, and TV shows.
0 stars 0 forks source link

Only query 5 entries for the profile to save DB usage #44

Closed ghost closed 2 years ago

ghost commented 2 years ago

Right now, we query a user's entire lists, then sort them on the backend before returning to the frontend the latest 5 entries.

Instead, we should query no more than 5 entries in the first place.

I didn't do this to begin with because it involves using two indexes (filter by user, and sort by update date), which seemed a little complicated in Fauna: https://stackoverflow.com/questions/61509089/how-to-query-by-multiple-conditions-in-faunadb

But I'll do it now.

dustinvtran commented 2 years ago

Sounds good to me!

ghost commented 2 years ago

60c22b8