Efficiently find slow queries?

Slow query performance is one of the leading bottlenecks for slow application performance. Is there any tool / library, which allows you to track down which exact queries, i.e. with reference to the code itself, similar to sentry, lead to a slow query performance? (Or rather show the performance for each query, so you can determine yourself, if the performance is acceptable or not) I'm aware, that database hosts itself show the performance of queries, but linking their query performance to the code is still a hurdle.
3 Replies
Lois
Lois2y ago
@jiasheng
Neto
Neto2y ago
Prisma
Configuring logging (Concepts)
Learn how to configure Prisma Client to log the raw SQL queries it sends to the database and other information.
Neto
Neto2y ago
Query: SELECT "public"."User"."id", "public"."User"."email", "public"."User"."name" FROM "public"."User" WHERE 1=1 OFFSET $1
Params: [0]
Duration: 3ms
Query: SELECT "public"."User"."id", "public"."User"."email", "public"."User"."name" FROM "public"."User" WHERE 1=1 OFFSET $1
Params: [0]
Duration: 3ms
if prisma isnt enough to analyse you will have to enter heavy db t3ggHeh
Want results from more Discord servers?
Add your server