removes joins on avatar and banner in endpoint /notes/children #303
Loading…
Reference in a new issue
No description provided.
Delete branch "puniko/FoundKey:fix/endpoint-children"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
this simply removes the joins from user to avatar and banner in the /notes/children endpoint.
fixes #256
currently running on my fork on mab, seems to be not needed at all in this endpoint. avatars and banners still show up as normal while being able to load children in threads much quicker.
would like to have some other people test it out first before merge
I think removing it in the endpoint will just mean that it will fetch the necessary information when packing the note, i.e. in
packages/backend/src/models/repositories/user.ts
. Essentially making a join outside the database which doesnt really sound like a good idea? It makes me even more confused. Perhaps because of the database query cache in redis...I noticed though that with this I think banner images will not be fetched any more. Did you by any chance try only removing the banner image join?
it seems tho that packing it outside is quicker than making the joins. (and yes, i noticed it still having the avatar links in the response json
i haven't tried it on the endpoint alone, but (as stated in the issue) removing either avatar or banner doesn't improve the speed of the query. only when i remove both, its being quicker again.
mmmh, might have to digg a bit deeper into this. you proposed a subquery? how would i go about it with this model implementation? (i think you might have more expr with this than me)
While I would still like to know why this is so slow it still seems okay to merge to me.