one prisma findMany with three includes takes 4.2s, hand written sql is 80ms Prisma
Postgres 16, about 120k rows in the child table. The call is . pg stat statements shows four separate statements, and the slow one is a select on items with an list of 50 ids doing a sequential scan. The equivalent…