---
title: "Neon Performance Analyzer: review, role & definition · Undominated.ai"
canonical: https://undominated.ai/agents/github-neon-performance-analyzer/
description: "Finds slow Postgres queries on a temporary Neon database branch, tests fixes on a second branch, and reports before-and-after metrics in a pull request."
---

# Neon Performance Analyzer: review, role & definition · Undominated.ai

> Finds slow Postgres queries on a temporary Neon database branch, tests fixes on a second branch, and reports before-and-after metrics in a pull request.

[← Explore all agents](/agents/)

DATA AND RETRIEVAL / GitHub partners

# Neon Performance Analyzer

Finds slow Postgres queries on a temporary Neon database branch, tests fixes on a second branch, and reports before-and-after metrics in a pull request.

 [Use this definition ↓](#setup)[Original source ↗](https://github.com/github/awesome-copilot/blob/156736fb63e965b2f547a1460f3b5972c46e6b24/agents/neon-optimization-analyzer.agent.md)

SOURCE REVIEW

 Reviewed 2026-10-13
 Evidence 5 linked sources
 Publisher GitHub partners
 Licence [MIT ↗](https://github.com/github/awesome-copilot/blob/156736fb63e965b2f547a1460f3b5972c46e6b24/LICENSE)
 Revision 156736fb63e9
 [Read what was—and wasn’t—checked ↓](#review)

“Identify and fix slow Postgres queries automatically using Neon's branching workflow. Analyzes execution plans, tests optimizations in isolated database branches, and provides clear before/after performance metrics with actionable code fixes.”

 [GitHub partners · upstream description ↗](https://github.com/github/awesome-copilot/blob/156736fb63e965b2f547a1460f3b5972c46e6b24/agents/neon-optimization-analyzer.agent.md) Our analysis follows below.

01 / THE REASONING

## Why this made the selection.

 - Analysis and tests run on Neon database branches with a four-hour TTL, never the main database branch, and both branches are deleted at the end.
- It reads pg_stat_statements on the analysis branch, ignores Neon's own internal queries, and re-runs the slow queries after each change to measure the difference.

### A good fit for

 - Finding and testing an index or query rewrite for a slow Neon Postgres query
- Listing the slowest queries by mean execution time from pg_stat_statements on a branch copy

### Weigh up before choosing

 - If pg_stat_statements is missing, it enables the extension on the analysis branch and tells the user.
- The before-and-after figures come from a branch copy of the data, not production traffic.
- Requires a Neon API key; the file says to use the Neon API directly and not neonctl. No tools field is declared.
- Creating branches and running queries uses Neon compute, which may be billed.

02 / THE REVIEW RECORD

## What we actually inspected.

Source review has boundaries. A clear record is more useful than a “safe” badge.

### Material inspected

 - agents/neon-optimization-analyzer.agent.md
- plugins/partners/plugin.json and README.md
- LICENSE

### Our findings

 - Listed in plugins/partners/plugin.json, whose description is Custom agents that have been created by GitHub partners. The commit history was not used to attribute authorship.
- It always qualifies branch as Neon database branch or git branch.
- It is told not to create new Markdown files.

### Not established by this review

 - The agent was not run.
- No Neon project was used.

The review applies to the material and revision named here. A newer upstream release can change its behavior.

03 / PUT IT TO WORK

## Use the role in your project.

[Upstream setup instructions ↗](https://github.com/github/awesome-copilot/blob/156736fb63e965b2f547a1460f3b5972c46e6b24/plugins/partners/README.md)

DOCUMENTED COMMAND

 copilot plugin install partners@awesome-copilot Copy command ↗

Copying does not execute this command. It may retrieve a newer version than the reviewed source.

 - The command installs the partners plugin, which bundles 20 partner agents, not only this one.
- For this agent alone, download the unchanged neon-optimization-analyzer.agent.md with its LICENSE.txt and place a reviewed copy in the workspace .github/agents/ folder, as the VS Code custom-agent documentation describes.
- Provide a Neon API key through the host's protected configuration and name an existing project; the file says not to create a new one.

### Before you start

 - GitHub Copilot with custom agents
- A Neon project and API key
- The repository whose queries are slow

### Compatibility

GitHub Copilot CLI (partners plugin) · GitHub Copilot custom agents (the mcp-servers block applies to the github-copilot target)

### Temporary Neon database branches and repository writes

 - No tools field is declared, so the host's tools apply.
- Through the Neon API it creates and deletes branches and runs SQL on them. The file forbids running on the main database branch.

### Cost model

MIT-licensed definition. Copilot, model usage and the vendor service it connects to have their own terms and charges, which were not measured.

THE COMPLETE REVIEWED DEFINITION

## Read it before you reuse it.

Original source bytes, with attribution. Review the host-specific setup notes above.

 Copy definition ↗ [Download definition + licence ↗](/resources/agents/github-neon-performance-analyzer/bundle.zip)[Raw Markdown ↗](/resources/agents/github-neon-performance-analyzer/definition.md)
 ---
name: Neon Performance Analyzer
description: Identify and fix slow Postgres queries automatically using Neon's branching workflow. Analyzes execution plans, tests optimizations in isolated database branches, and provides clear before/after performance metrics with actionable code fixes.
---

# Neon Performance Analyzer

You are a database performance optimization specialist for Neon Serverless Postgres. You identify slow queries, analyze execution plans, and recommend specific optimizations using Neon's branching for safe testing.

## Prerequisites

The user must provide:

- **Neon API Key**: If not provided, direct them to create one at https://console.neon.tech/app/settings#api-keys
- **Project ID or connection string**: If not provided, ask the user for one. Do not create a new project.

Reference Neon branching documentation: https://neon.com/llms/manage-branches.txt

**Use the Neon API directly. Do not use neonctl.**

## Core Workflow

1. **Create an analysis Neon database branch** from main with a 4-hour TTL using `expires_at` in RFC 3339 format (e.g., `2025-07-15T18:02:16Z`)
2. **Check for pg_stat_statements extension**:
 ```sql
 SELECT EXISTS (
 SELECT 1 FROM pg_extension WHERE extname = 'pg_stat_statements'
 ) as extension_exists;
 ```
 If not installed, enable the extension and let the user know you did so.
3. **Identify slow queries** on the analysis Neon database branch:
 ```sql
 SELECT
 query,
 calls,
 total_exec_time,
 mean_exec_time,
 rows,
 shared_blks_hit,
 shared_blks_read,
 shared_blks_written,
 shared_blks_dirtied,
 temp_blks_read,
 temp_blks_written,
 wal_records,
 wal_fpi,
 wal_bytes
 FROM pg_stat_statements
 WHERE query NOT LIKE '%pg_stat_statements%'
 AND query NOT LIKE '%EXPLAIN%'
 ORDER BY mean_exec_time DESC
 LIMIT 10;
 ```
 This will return some Neon internal queries, so be sure to ignore those, investigating only queries that the user's app would be causing.
4. **Analyze with EXPLAIN** and other Postgres tools to understand bottlenecks
5. **Investigate the codebase** to understand query context and identify root causes
6. **Test optimizations**:
 - Create a new test Neon database branch (4-hour TTL)
 - Apply proposed optimizations (indexes, query rewrites, etc.)
 - Re-run the slow queries and measure improvements
 - Delete the test Neon database branch
7. **Provide recommendations** via PR with clear before/after metrics showing execution time, rows scanned, and other relevant improvements
8. **Clean up** the analysis Neon database branch

**CRITICAL: Always run analysis and tests on Neon database branches, never on the main Neon database branch.** Optimizations should be committed to the git repository for the user or CI/CD to apply to main.

Always distinguish between **Neon database branches** and **git branches**. Never refer to either as just "branch" without the qualifier.

## File Management

**Do not create new markdown files.** Only modify existing files when necessary and relevant to the optimization. It is perfectly acceptable to complete an analysis without adding or modifying any markdown files.

## Key Principles

- Neon is Postgres—assume Postgres compatibility throughout
- Always test on Neon database branches before recommending changes
- Provide clear before/after performance metrics with diffs
- Explain reasoning behind each optimization recommendation
- Clean up all Neon database branches after completion
- Prioritize zero-downtime optimizations

The download contains neon-optimization-analyzer.agent.md . Keep its filename when placing it in the agent directory described above.

By **GitHub partners**. [Exact upstream source ↗](https://raw.githubusercontent.com/github/awesome-copilot/156736fb63e965b2f547a1460f3b5972c46e6b24/agents/neon-optimization-analyzer.agent.md) · [Licence](/resources/agents/github-neon-performance-analyzer/LICENSE.txt) · [Attribution](/resources/agents/github-neon-performance-analyzer/ATTRIBUTION.txt)

SHA-256 93fe6bca30ad11d81bca5661a180608196c84af0994aa0ca6f353aebb221fc6a

 Read the applicable licence MIT License

Copyright GitHub, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

04 / FOLLOW THE EVIDENCE

## The source trail.

Our notes are separate from the original resource. Check upstream before adopting a new version.

 - [Agent definition ↗](https://github.com/github/awesome-copilot/blob/156736fb63e965b2f547a1460f3b5972c46e6b24/agents/neon-optimization-analyzer.agent.md) Checked 2026-10-13 https://github.com/github/awesome-copilot/blob/156736fb63e965b2f547a1460f3b5972c46e6b24/agents/neon-optimization-analyzer.agent.md Supports: summary, upstreamDescription, whySelected, limitations, access, review
- [Partners plugin manifest ↗](https://github.com/github/awesome-copilot/blob/156736fb63e965b2f547a1460f3b5972c46e6b24/plugins/partners/plugin.json) Checked 2026-10-13 https://github.com/github/awesome-copilot/blob/156736fb63e965b2f547a1460f3b5972c46e6b24/plugins/partners/plugin.json Supports: publisher
- [Partners plugin README: install line ↗](https://github.com/github/awesome-copilot/blob/156736fb63e965b2f547a1460f3b5972c46e6b24/plugins/partners/README.md) Checked 2026-10-13 https://github.com/github/awesome-copilot/blob/156736fb63e965b2f547a1460f3b5972c46e6b24/plugins/partners/README.md Supports: install
- [Repository licence (MIT) ↗](https://github.com/github/awesome-copilot/blob/156736fb63e965b2f547a1460f3b5972c46e6b24/LICENSE) Checked 2026-10-13 https://github.com/github/awesome-copilot/blob/156736fb63e965b2f547a1460f3b5972c46e6b24/LICENSE Supports: license
- [VS Code custom agents: locations and frontmatter ↗](https://code.visualstudio.com/docs/copilot/customization/custom-agents) Checked 2026-10-13 https://code.visualstudio.com/docs/copilot/customization/custom-agents Supports: install, compatibility

KEEP COMPARING

## Other approaches to consider.

Related by category or shared topics. These are alternatives to inspect, not a measured quality order.

 [### MongoDB Performance Advisor ↗ Combines repository query patterns with read-only MongoDB diagnostics to explain query plans and index trade-offs.](/agents/github-mongodb-performance-advisor/)[### Database Cloud Optimization Database Optimizer ↗ Investigates database bottlenecks from query plans and workload evidence, then proposes query, index, caching or partitioning changes with validation.](/agents/wshobson-database-optimizer/)[### Database Reviewer ↗ Reviews PostgreSQL queries, schemas and migrations for performance, integrity and Row Level Security, reporting findings only.](/agents/ecc-database-reviewer/)

 [AI Tools ↗](/tools/)[Skills ↗](/skills/)[Agents ↗](/agents/)[MCP Servers ↗](/mcp-servers/)[Workflows ↗](/workflows/)

## Continue your investigation

 - [Find reusable instructions](/skills/)
- [Inspect connections](/mcp-servers/)
- [Build a toolkit](/tools/)
- [Choose the model](/compare/)
