Open jacob-hansen opened 1 year ago
@janpio
I don't know if this is related, but here is the error we are getting when trying to load a table with lots of relations (from our cluster):
node:events:498
throw er; // Unhandled 'error' event
^
Error: ENOENT: no such file or directory, open '/app/node_modules/prisma/engines/34ace0eb2704183d2c05b60b52fba5c43c13f303/libquery_engine-debian-openssl-3.0.x.so.node'
Emitted 'error' event on ReadStream instance at:
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/app/node_modules/prisma/engines/34ace0eb2704183d2c05b60b52fba5c43c13f303/libquery_engine-debian-openssl-3.0.x.so.node'
}
Node.js v22.3.0
It is very consistent and reproduces every time, regardless of:
Filters
,Showing
(i.e. pagination).Changing any params (such as doing Take 1
) still crashes the Prisma Studio pod, as I assume it tries to load relations in-memory.
Here's part of our schema.prisma
:
generator client {
provider = "prisma-client-js"
// TODO: Enabling this actually _reduces_ performance (albeit it should be increasing it). What we are experiencing is similar to the issue described here https://github.com/prisma/prisma/discussions/22288#discussioncomment-7847470
// previewFeatures = ["relationJoins", "nativeDistinct"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
Bug description
Creating a one to many relationship table with a large quantity of many (1M+) causes prisma studio to fail to load the table due to memory issues. This makes sense if I was trying to display the entire row, including the relations. But when I select just a column or two that are not part of the relations, it still fails to load.
How to reproduce
// with 2-5 products, write 1M+ sales
Expected behavior
Query just the columns of question as to not run out of memory
Prisma information
Environment & setup
Prisma logs
prisma:query COMMIT prisma:query SELECT 1 prisma:query BEGIN