Prisma trace questions
Some performance findings and questions for a Prisma/Zenstack project, using Supabase for the database. This is using Prisma's tracing feature to investigate some slow queries.
I did a comparison of the traces of the same query (1) connecting to my local supabase instance vs (2) connecting to our remote supabase project.
My local supabase instance was unsurprisingly much quicker, as my remote instance is in Germany and I am currently based in Thailand. However I expected this location difference to increase latency in the Prisma trace ‘prisma:engine:connection’ which Prisma defines as ‘Represents how long it takes for Prisma Client to get a database connection’. While this trace did increase, I’m also seeing huge increases in ‘prisma:engine:db_query’ (Represents the database query that was executed against the database). It should not be taking almost 400ms for a find query that is querying via the primary key. In contrast the same query against my local db took 700us.
I took a db dump so the data is the same in both, and running an explain analyze on the query revealed it is using the primary key index.
Is the Prisma trace name just misleading or is there something else going on?
0 Replies