P
Prisma6mo ago
yahya

Super slow queries when filter JSON

Hello, I asked the same question to @kapa.ai but couldn't figure out what to do basically my queries are super slow when running filters on raw JSON values with postgresql should I switch to mongodb?
await prisma.dataEntry.findMany({
where:{ ...,
AND: [
{
raw: { path: [key], not: "" },
},
{
raw: { path: [key], not: Prisma.DbNull },
},
{
raw: { path: [key], not: Prisma.JsonNull },
},
]
},
...
})
await prisma.dataEntry.findMany({
where:{ ...,
AND: [
{
raw: { path: [key], not: "" },
},
{
raw: { path: [key], not: Prisma.DbNull },
},
{
raw: { path: [key], not: Prisma.JsonNull },
},
]
},
...
})
model DataEntry {
id String @id @default(cuid())

raw Json

upload DataUpload @relation(fields: [uploadId], references: [id], onDelete: Cascade)
uploadId String
users User[]

createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model DataEntry {
id String @id @default(cuid())

raw Json

upload DataUpload @relation(fields: [uploadId], references: [id], onDelete: Cascade)
uploadId String
users User[]

createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
what can I do?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server