> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pawsql.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> PawSQL 是一个产品：Cloud 是公网部署形态，Engine / Optimizer / Auditor / Advisor / Patroller 是同一产品的组件与交付形态，不是彼此独立的产品。 / PawSQL is a single product: Cloud is the public deployment form, while Engine / Optimizer / Auditor / Advisor / Patroller are components and delivery forms of the same product, not separate products.
> 术语以站内术语表为准：SQL 审核对应英文 SQL Review，查询重写对应 Query Rewrite，索引推荐对应 Index Recommendation；英文内容统一用 Review，不用 Audit。 / Use the site glossary for terminology: 审核 is SQL Review, 重写 is Query Rewrite, 索引推荐 is Index Recommendation; English content uses Review, never Audit.
> 引用能力范围或版本支持时以对应页面为准；标注 unknown、或 status 非 published 的内容表示尚未经产品核实，不应作为事实引用。 / Cite capability scope and version support from the corresponding page; content marked unknown, or with a status other than published, is not yet product-verified and must not be cited as fact.

# Core Features

> Explore PawSQL capabilities for SQL quality, optimization, performance intelligence, SQL governance, and developer workflow integration.

PawSQL is a **SQL engineering and governance platform** for developers, QA teams, DBAs, and enterprise database teams.

It provides a unified set of capabilities across the SQL lifecycle: from development-time review and optimization, to pre-release quality gates, production slow-SQL remediation, performance validation, and continuous SQL governance.

PawSQL capabilities are organized into five areas:

* **SQL Quality** — detect syntax, policy, risk, and potential performance issues
* **SQL Optimization** — automatically rewrite SQL, recommend indexes, and optimize database-specific workloads
* **Performance Intelligence** — validate improvements using execution plans, cost, and database optimizers
* **SQL Governance** — operationalize SQL quality and performance controls across CI/CD, production, and enterprise processes
* **Platform & Integration** — connect PawSQL with IDEs, CI/CD, APIs, webhooks, MCP, and internal platforms

***

## From SQL Analysis to Enterprise Governance

PawSQL goes beyond answering “what is wrong with this SQL statement?”

It also helps answer:

* Does the SQL violate coding or operational policies?
* Is there a semantically equivalent but more efficient form?
* Should an index be created or changed?
* Does the optimized version actually produce a better execution plan?
* Can the same checks be enforced automatically across development and release workflows?

```mermaid theme={null}
flowchart TD
  subgraph sgOverview["Capability Overview"]
    A["SQL"] --> B["SQL Quality"]
    B --> C1["SQL Optimization<br>Rewrite / Index Analysis"]
    B --> C2["Risk & Policy<br>SQL Quality"]
    C1 --> D["Performance Validation"]
    C2 --> D
    D --> E["SQL Governance"]
    E --> F["IDE / CI/CD / API / Webhook / MCP"]
  end
```

***

## SQL Quality

Identify SQL issues before they reach testing, release, or production.

PawSQL performs structured SQL analysis using parsing, semantic analysis, database metadata, and rule engines instead of relying only on text matching or regular expressions.

### Key capabilities

* SQL syntax and compatibility checks
* SQL coding policy review
* High-risk DDL and DML detection
* Potential performance issue detection
* Database-specific rules
* Enterprise custom rules
* Stored procedure SQL analysis

### Typical scenarios

Developer self-review, code review, release checks, database change review, and enterprise SQL policy enforcement.

<CardGroup cols={2}>
  <Card title="SQL Quality Check" icon="list-check" href="/en/features/sql-review">
    Identify standards, safety, and performance risks before release.
  </Card>
</CardGroup>

***

## SQL Optimization

Automatically discover more efficient SQL forms and index strategies.

PawSQL combines SQL parsing, semantic equivalence analysis, rewrite rules, index analysis, and database optimizer information to generate optimization candidates.

### Key capabilities

* Query Rewrite
* Subquery optimization
* Join optimization
* Predicate pushdown
* Aggregation and sorting optimization
* Deep pagination optimization
* Index Recommendation
* Distributed SQL optimization
* Big data SQL optimization

The goal is not simply to produce suggestions, but to generate optimization candidates that can be evaluated and applied.

```mermaid theme={null}
flowchart LR
  subgraph sgRewrite["SQL Optimization"]
    A["Original SQL"] --> B["Parsing & Semantic Analysis"]
    B --> C["Rewrite / Index Analysis"]
    C --> D["Optimization Candidate"]
    D --> E["Performance Validation"]
    E --> F["Optimized SQL"]
  end
```

<CardGroup cols={2}>
  <Card title="Query Rewrite" icon="git-compare" href="/en/features/automatic-sql-rewrite">
    Generate semantically equivalent rewrites automatically.
  </Card>

  <Card title="Index Recommendation" icon="scan-search" href="/en/features/index-recommendation">
    Recommend candidate indexes from query access patterns.
  </Card>

  <Card title="Distributed SQL Optimization" icon="network" href="/en/features/distributed-sql-optimization">
    Sharding keys, distributed joins, and cross-node access.
  </Card>

  <Card title="Big Data SQL Optimization" icon="hard-drive" href="/en/features/big-data-sql-optimization">
    Skew and execution optimization for Hive and similar engines.
  </Card>
</CardGroup>

***

## Performance Intelligence

Determine whether an optimization actually improves the SQL.

SQL optimization should not rely only on heuristic rules. PawSQL uses database optimizer information, execution plans, and cost comparison to evaluate original and optimized SQL.

### Key capabilities

* Before-and-after execution plan comparison
* SQL cost comparison
* Index effectiveness validation
* Execution Plan Analysis
* High-cost operator detection
* Full-scan and large-volume operation detection
* Slow SQL analysis
* Optimization benefit assessment

```mermaid theme={null}
flowchart TD
  subgraph sgPerf["Performance Validation"]
    A["Original SQL Plan<br>Execution Plan"] <--> B["Optimized SQL Plan<br>Execution Plan"]
    A --> C["Plan & Cost Comparison"]
    B --> C
    C --> D["Optimization Result"]
  end
```

This creates a complete optimization loop:

<Note>
  **Detect → Optimize → Validate**
</Note>

<CardGroup cols={2}>
  <Card title="Performance Validation" icon="gauge" href="/en/features/performance-validation">
    Confirm with the database optimizer that a change is actually faster.
  </Card>

  <Card title="Execution Plan Analysis" icon="list-tree" href="/en/features/execution-plan-visualization">
    Turn text plans into a visual execution tree.
  </Card>
</CardGroup>

The two play different roles: **Performance Validation answers "is it better?"** — it compares plans and cost before and after, and produces a judgment you can rely on. **Execution Plan Analysis answers "what does the plan look like?"** — it renders plan structure and metrics so you can locate bottlenecks and understand what changed. One produces the verdict, the other the evidence.

***

## SQL Governance

Scale SQL optimization from individual statements to continuous enterprise governance.

When organizations need to manage thousands or millions of SQL statements, manual review and optimization cannot keep pace with modern delivery processes.

PawSQL integrates SQL analysis, risk control, and performance optimization into development, deployment, migration, and production workflows.

### Key capabilities

* CI/CD SQL Quality Gate
* Batch SQL quality checks and optimization
* SQL fingerprinting
* Slow SQL governance
* Database migration SQL governance
* SQL risk classification
* Optimization prioritization
* Enterprise SQL governance dashboards

### Typical workflow

```mermaid theme={null}
flowchart TD
  subgraph sgGov["SQL Governance"]
    A["Developer / DBA / Migration"] --> B["SQL Collection"]
    B --> C["PawSQL Analysis"]
    C --> D1["Risk"]
    C --> D2["Rewrite"]
    C --> D3["Index"]
    D1 --> E["Performance Validation"]
    D2 --> E
    D3 --> E
    E --> F["Governance Policy"]
    F --> G1["Pass"]
    F --> G2["Block"]
  end
```

<CardGroup cols={2}>
  <Card title="SQL Quality Gate" icon="shield-check" href="/en/use-cases/sql-quality-gate-cicd">
    Enforce SQL quality gates in CI/CD.
  </Card>

  <Card title="Batch SQL Governance" icon="gauge" href="/en/use-cases/slow-sql-optimization">
    Govern production slow SQL at scale.
  </Card>
</CardGroup>

***

## Platform & Integration

Bring SQL intelligence into the tools your teams already use.

PawSQL can run inside development, DevOps, internal database platforms, and AI agent workflows instead of operating only as a standalone SQL tool.

### Integration options

| Integration | Typical use                                          |
| ----------- | ---------------------------------------------------- |
| IDE         | Development-time SQL quality checks and optimization |
| CI/CD       | Pre-release SQL quality gates                        |
| REST API    | Enterprise platform and automation integration       |
| Webhook     | DevOps workflow triggers                             |
| MCP         | SQL quality checks and optimization for AI agents    |
| Web Console | DBA and enterprise SQL governance                    |

Typical integrations include:

* JetBrains
* Visual Studio Code
* Jenkins
* GitLab CI/CD
* Coding
* Enterprise DevOps platforms
* AI coding agents
* Internal database management platforms

<CardGroup cols={2}>
  <Card title="IDE Extensions" icon="code" href="/en/user-guide/installation/ide-plugins">
    Review and optimize SQL in DBeaver, IntelliJ IDEA, DataGrip, or VS Code.
  </Card>

  <Card title="CI/CD Integration" icon="git-merge" href="/en/user-guide/cicd/index">
    Enforce SQL quality gates in your pipeline.
  </Card>

  <Card title="PawSQL MCP" icon="bot" href="/en/user-guide/dev-tools/mcp">
    Let AI coding assistants call SQL quality checks and optimization.
  </Card>

  <Card title="API Reference" icon="plug" href="/api-reference/list-workspaces">
    Integrate with enterprise platforms and automation.
  </Card>
</CardGroup>

***

## One Platform for Heterogeneous Database Environments

Modern enterprises often operate traditional relational databases, domestic database systems, distributed databases, and big data platforms at the same time.

PawSQL provides a unified SQL analysis model and a consistent review, optimization, and governance experience across heterogeneous database environments.

```mermaid theme={null}
flowchart TD
  subgraph sgMultiDb["Multi-Database Architecture"]
    A["PawSQL"] --> B1["Traditional Databases<br>MySQL<br>PostgreSQL<br>Oracle<br>SQL Server<br>DB2<br>…"]
    A --> B2["Distributed Databases<br>OceanBase<br>TDSQL<br>GaussDB<br>PolarDB-X<br>GoldenDB<br>…"]
    A --> B3["Big Data<br>Hive<br>…"]
  end
```

For database versions and capability coverage, see:

[Supported Databases →](/en/getting-started/supported-databases)

***

## Typical Ways to Use PawSQL

Different roles can enter PawSQL through different workflows.

| Role                   | Typical need                                           | Recommended capabilities                                           |
| ---------------------- | ------------------------------------------------------ | ------------------------------------------------------------------ |
| Developer              | Detect and optimize SQL while coding                   | SQL Quality Check, Query Rewrite, Developer Tool Integration       |
| DBA                    | Remediate slow SQL and index issues at scale           | Batch SQL Governance, Index Recommendation, Performance Validation |
| DevOps                 | Block risky SQL before deployment                      | SQL Quality Gate, CI/CD Integration                                |
| Migration Team         | Validate compatibility and performance after migration | Database Migration Governance                                      |
| Database Platform Team | Build a unified SQL governance platform                | API, Policy, Dashboard, Multi-Database Support                     |
| AI Agent               | Validate and optimize generated SQL                    | MCP, SQL Quality Check, SQL Optimization                           |

***

## The PawSQL Capability Loop

PawSQL organizes SQL quality and performance engineering into a continuous lifecycle:

```mermaid theme={null}
flowchart LR
  subgraph sgLoop["Continuous Improvement"]
    A["Write"] --> B["Review"] --> C["Optimize"] --> D["Validate"] --> E["Release"] --> F["Monitor"] --> G["Govern"]
    G -.-> A
  end
```

↺ Continuous Improvement

SQL optimization therefore becomes a repeatable engineering capability rather than a reactive activity performed only after performance incidents occur.

***

## Next Steps

If you are new to PawSQL, continue with these core capabilities:

<CardGroup cols={2}>
  <Card title="Use Cases" icon="compass" href="/en/use-cases/index">
    See how PawSQL fits real development and database governance workflows.
  </Card>

  <Card title="Supported Databases" icon="database" href="/en/getting-started/supported-databases">
    Confirm database, version, and capability coverage.
  </Card>
</CardGroup>
