-
Notifications
You must be signed in to change notification settings - Fork 903
feat(blog): query insights blog added #7669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aidankmcalister
wants to merge
1
commit into
main
Choose a base branch
from
feat/query-insights-blog
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
102 changes: 102 additions & 0 deletions
102
apps/blog/content/blog/announcing-query-insights-for-prisma-postgres/index.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| --- | ||
| title: "Announcing Query Insights For Prisma Postgres" | ||
| slug: "announcing-query-insights-for-prisma-postgres" | ||
| date: "2026-03-18" | ||
| authors: | ||
| - "Ankur Datta" | ||
| - "Aidan McAlister" | ||
| metaTitle: "Announcing Query Insights For Prisma Postgres" | ||
| metaDescription: "Query Insights gives you built-in visibility into how your database queries behave in production. It is included in Prisma Postgres and works out of the box without any setup." | ||
| metaImagePath: "/announcing-query-insights-for-prisma-postgres/announcing-query-insights-for-prisma-postgres-og.png" | ||
| heroImagePath: "/announcing-query-insights-for-prisma-postgres/announcing-query-insights-for-prisma-postgres-og.png" | ||
| --- | ||
|
|
||
| Query Insights gives you built-in visibility into how your database queries behave in production. It is included in Prisma Postgres and works out of the box without any setup. | ||
|
|
||
| ## Why we built Query Insights | ||
|
|
||
| When something feels slow in your app, the first question is usually simple: | ||
|
|
||
| **Which query is causing this?** | ||
|
|
||
| The hard part is getting the answer. | ||
|
|
||
| A request takes longer than usual. An endpoint starts timing out. Database usage increases. But it is often difficult to understand which queries are responsible, how often they run, and how much load they create. | ||
|
|
||
| This matters even more now that many developers are building with AI tools. | ||
|
|
||
| AI can help you move faster, but it can also generate database logic that does more work than necessary. A single user action can end up triggering many queries instead of a small number of efficient ones, which increases latency and database usage. | ||
|
|
||
| We built **Query Insights** to give you a clear view of what your database is doing in production. | ||
|
|
||
| Because it is built into **Prisma Postgres**, you can immediately see which queries are slow, which ones run most often, and which ones are having the biggest impact on your database. | ||
|
|
||
| ## Open your dashboard and see what your database is doing | ||
|
|
||
| Query Insights is available directly inside **Prisma Postgres**. | ||
|
|
||
| There is no setup required. | ||
|
|
||
| Just open your **Prisma Postgres dashboard**, go to the **Queries** tab, and you can immediately see how your queries behave in production. | ||
|
|
||
| Instead of guessing where performance issues might be coming from, you get a clear view of the queries your application is running and how they affect your database. | ||
|
|
||
|  | ||
|
|
||
| ## Quickly spot the queries that matter | ||
|
|
||
| When you open the **Queries** tab, patterns start to appear. | ||
|
|
||
| Queries are grouped by their shape, which makes them easier to analyze. For each group, you can see latency, read volume, and how often the query runs. | ||
|
|
||
| This helps answer questions you often run into when debugging performance: | ||
|
|
||
| - Which queries are slowing down my application? | ||
| - Which queries are creating the most load on my database? | ||
| - Which queries run often enough that optimizing them would make a difference? | ||
|
|
||
| Instead of digging through logs or trying to reproduce an issue locally, you can quickly see which queries have the biggest impact. | ||
|
|
||
|  | ||
|
|
||
| ## Turn a slow query into an optimization prompt for your agent | ||
|
|
||
| Once you find a query that needs attention, the next step is figuring out how to improve it. | ||
|
|
||
| Query Insights helps with that too. | ||
|
|
||
| For each query group, it generates a **structured optimization prompt**. The prompt explains why the query might be inefficient, highlights possible causes such as missing indexes or unnecessary reads, and suggests ways to improve performance. | ||
|
|
||
| You can copy this prompt and paste it into your preferred AI coding assistant to explore possible optimizations. | ||
|
|
||
| Instead of staring at a slow query and wondering where to start, you get a clear direction on what to investigate. | ||
|
|
||
|  | ||
|
|
||
| ## See the path from application code to SQL | ||
|
|
||
| Performance issues often involve multiple layers of your stack. | ||
|
|
||
| An endpoint in your application becomes slow. That request triggers a query. That query turns into SQL executed by your database. | ||
|
|
||
| Query Insights helps connect these layers. | ||
|
|
||
| It links your **application query** to the **SQL generated by Prisma ORM**, and shows the runtime impact of that query. | ||
|
|
||
| This makes it easier to understand exactly which part of your code is responsible for increased load or slower responses. | ||
|
|
||
| ORM-to-SQL attribution works specifically with Prisma ORM. At the same time, Query Insights also shows SQL coming from other tools so you still get a complete picture of what is happening in your database. | ||
|
|
||
|  | ||
|
|
||
| ## Built in and ready to use | ||
|
|
||
| Query Insights is included with **Prisma Postgres** and there is nothing to enable. | ||
|
|
||
| Create a database, open the **Queries** tab, and start exploring how your queries behave in production. | ||
|
|
||
| <Button className="w-fit my-10 mx-auto no-underline" variant="ppg" size="4xl" href="https://pris.ly/pdp-qi?utm_campaign=query-insights">Visit the console</Button> | ||
|
|
||
| This is just the beginning! We are continuing to improve Query Insights and add more capabilities. | ||
|
|
||
| More updates are on the way, so stay tuned on our X or Discord! | ||
Binary file added
BIN
+10.9 MB
...hts-for-prisma-postgres/announcing-query-insights-for-prisma-postgres-gif-1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.69 MB
...hts-for-prisma-postgres/announcing-query-insights-for-prisma-postgres-gif-2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.9 MB
...hts-for-prisma-postgres/announcing-query-insights-for-prisma-postgres-gif-3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.3 MB
...hts-for-prisma-postgres/announcing-query-insights-for-prisma-postgres-gif-4.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+265 KB
...sights-for-prisma-postgres/announcing-query-insights-for-prisma-postgres-og.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.