Optimize Record and Analyze a Session
A 4-step recipe with Prisma. We can help you get access.
Recipe · 4 steps
Optimize Record and Analyze a Session
with Prisma
Works with AI assistants
Create a recording session, fetch its slowest queries and recommendations, and stop it.
- Open a new query recording session for the supplied database provider.
- List the queries captured during the session ordered by duration descending so the slowest queries surface first.
- Pull the AI-powered optimization recommendations generated for the captured queries in the session.
- Stop the recording session to finalize the captured query data for analysis. No further queries are captured after this.
What you'll need to have ready
- apiKey: Optimize API key, sent as a Bearer token in the Authorization header.
- sessionName: Optional display name for the recording session.
- databaseProvider: Database provider being recorded (postgresql, mysql, cockroachdb, or sqlserver).
For your developer
Arazzo workflow prisma:record-and-analyze-session, 4 operations: createSession → listSessionQueries → listRecommendations → stopSession. Specs on APIs.io.