Julian IncrEdelman
PPrisma
•Created by Julian IncrEdelman on 11/18/2024 in #help-and-questions
Raw SQL returns ~5x slower than CLI / `pg` package
I have a query that returns 170k rows of two 4-byte integer (so ~1.5MB total).
When I run this on the CLI (pgsql), I get a ~500ms runtime. Using
queryRawUnsafe
or queryRaw
. the query is 2-3 secs.
I even hooked up the pg
package and confirmed it is around ~500ms.
Whu could Prisma be adding this overhead? Is there anything I could do to minimize it?
Some other info:
- I am running this in a serialized transaction; I see no perf difference when without a transaction
- the query basically looks like this: (where image_id and label_id are 4 byte ints)
- but, again, running this same command via pg
or psql
is ~5x faster than the Prisma options...7 replies
PPrisma
•Created by Julian IncrEdelman on 11/17/2024 in #help-and-questions
Tracing / OTEL only works with manual active spans.
I have just spent a few hours pulling my hair out to no avail. I tried to boil things down simply:
Ths code does not submit any traces to the console nor Jaeger UI:
Confusingly, if I send a manual trace, it shows up in the Jager UI. This indicates to me that something about the Prisma configuration is not working (I have followed the steps in the documentation... (1) enabled
tracing (2) placed init before any code (3) run
npx prisma generate`)
7 replies