Performance problem
Hi all!
We have a problem with performance. We use prisma 5.21 and I measure time for a call where we get a batch of 50 objects and the response is about 800kb. Currently it takes about 1.9s to get the response from prisma.
Does that sound reasonable? Any ideas on where I should start troubleshooting? My code below:
const recruitments = await prisma.recruitment.findMany({
where,
take, // 50
skip,
orderBy,
include: {
company: {
include: { contacts: true },
},
recruiter: true,
recruiterGuests: true,
recruiterExternals: true,
jobAd: true,
process: {
orderBy: {
order: "asc",
},
},
regions: true,
occupationalAreas: true,
occupationalGroups: true,
applications: true,
profileFile: true,
recruitmentSelectedPublishChannels: {
include: {
publishChannel: {
include: {
selected: true,
},
},
},
},
addons: true,
selection: {
include: {
recruitments: true,
answers: true,
},
},
symbols: true,
},
})
We have a problem with performance. We use prisma 5.21 and I measure time for a call where we get a batch of 50 objects and the response is about 800kb. Currently it takes about 1.9s to get the response from prisma.
Does that sound reasonable? Any ideas on where I should start troubleshooting? My code below:
const recruitments = await prisma.recruitment.findMany({
where,
take, // 50
skip,
orderBy,
include: {
company: {
include: { contacts: true },
},
recruiter: true,
recruiterGuests: true,
recruiterExternals: true,
jobAd: true,
process: {
orderBy: {
order: "asc",
},
},
regions: true,
occupationalAreas: true,
occupationalGroups: true,
applications: true,
profileFile: true,
recruitmentSelectedPublishChannels: {
include: {
publishChannel: {
include: {
selected: true,
},
},
},
},
addons: true,
selection: {
include: {
recruitments: true,
answers: true,
},
},
symbols: true,
},
})