do you think that there is any performance disadva...
# orm-help
o
do you think that there is any performance disadvantage of doing this?
f
It depends on your DB but if you're using a SQL db it actually performs a JOIN operation so you should be okay as long as the post doesn't have thousands of users
o
so, running 11 query for 10 post is not a big deal?
because it runs
prisma.post.findUnique({id: 1, select: { user: true } })
for each post
f
Oh, wait, I thought you asked about fetching multiple users on the same post
For that use case I believe it's best to do
prisma.post.findMany({where: {id: { in: [1,2,3] } }, include: { users: true } })