# PostgresAI vs Azure PostgreSQL built-in tools: any provider vs Azure only

> Azure Database for PostgreSQL includes Query Store and autonomous tuning with index advice. PostgresAI runs the same checkups on any provider and files Issues with a fix.

Checked on 2026-11-18. Page: https://postgres.ai/compare/postgresai-vs-azure-database-for-postgresql. All comparisons: https://postgres.ai/compare.

## Short answer

Azure Database for PostgreSQL flexible server includes Query Store, Query Performance Insight, autonomous tuning (index, ANALYZE and VACUUM recommendations), intelligent tuning and adaptive autovacuum, and troubleshooting guides. They come with the server and Query Store has no extra charge. PostgresAI monitors PostgreSQL on any provider and turns checkup findings into Issues with a fix. On Azure, use both: keep the built-in tools, and add PostgresAI for checkups, agent access, history beyond Azure's limits or expert help.

## Where PostgresAI is ahead of Azure PostgreSQL built-in tools

1. **The same checks wherever Postgres runs.**
   - PostgresAI: Amazon RDS and Aurora, Google Cloud SQL, Azure Database for PostgreSQL, Supabase, Tiger Data, self-managed servers and Postgres running on Kubernetes. ([PostgresAI monitoring overview](https://postgres.ai/docs/monitoring))
   - Azure PostgreSQL built-in tools: Microsoft describes autonomous tuning as a built-in offering of Azure Database for PostgreSQL flexible server. It needs at least 4 vCores, adaptive autovacuum is not supported on elastic clusters, and Microsoft says not to enable Query Store on the Burstable tier. [3][6][1]
2. **13 months of history.**
   - PostgresAI: Scale keeps 13 months of history. ([Pricing](https://postgres.ai/pricing))
   - Azure PostgreSQL built-in tools: Query Store keeps 7 days by default and at most 30. Azure Monitor metrics are kept up to 93 days, with at most 30 days on one chart. Autonomous tuning recommendations are deleted 35 days after they were last produced. [1][8][3]
3. **Test the fix on a full-size copy first.**
   - PostgresAI: With DBLab Engine, a separate open-source product, an index or query change runs on a full-size thin clone of the database, created in seconds, before it reaches production. ([DBLab Engine](https://postgres.ai/docs/database-lab), [DBLab compared with other ways to branch](https://postgres.ai/compare#branching))
   - Azure PostgreSQL built-in tools: Autonomous tuning evaluates candidate indexes with the hypopg extension and reports the estimated plan cost improvement per query. The sources we reviewed do not describe running a change on a separate copy of the data. [3]
4. **Open source, no licence fee to self-host.**
   - PostgresAI: The monitoring software is open source under Apache 2.0, so self-hosting it carries no licence fee. ([postgresai repository](https://gitlab.com/postgres-ai/postgresai), [How much does it cost?](https://postgres.ai/docs/questions-and-answers))
   - Azure PostgreSQL built-in tools: These tools are features of Azure Database for PostgreSQL, which Microsoft describes as a fully managed database service, and they run only inside that service. [13][3]

## Check it on your own database

```
npx postgresai@latest checkup postgresql://user@host:5432/db --no-upload
```

The express checkup works with PostgreSQL 14 or newer. With --no-upload it needs no account and sends no report data to PostgresAI. It needs Node.js 18 or newer and a database role with pg_monitor. Compare what it finds with what your current tool shows for the same database.

- [Live demo (login demo, password demo)](https://demo.postgres.ai)
- [Checkup command reference](https://postgres.ai/docs/reference-guides/postgresai-cli-reference#command-checkup)

## Side by side

| | PostgresAI | Azure PostgreSQL built-in tools |
|---|---|---|
| What it is | PostgreSQL monitoring with scheduled health checkups. Findings become Issues with severity, evidence and a recommended fix, which you, your AI agent or a PostgresAI expert can act on. | Features of Azure Database for PostgreSQL flexible server: Query Store, Query Performance Insight in the portal, autonomous tuning recommendations, intelligent tuning and adaptive autovacuum that change parameters, troubleshooting guides, and Azure Monitor metrics and logs. [1][2][3][5][7] |
| Where your Postgres can run, and which versions | Any provider: yes. Amazon RDS and Aurora, Google Cloud SQL, Azure Database for PostgreSQL, Supabase, Tiger Data, self-managed servers and Postgres running on Kubernetes. PostgreSQL 14 and newer, with the pg_stat_statements extension. | Any provider: no. Only Azure Database for PostgreSQL flexible server, which supports PostgreSQL 11 to 18, with 11 to 13 under extended support. Autonomous tuning needs PostgreSQL 12 or newer and adaptive autovacuum parameter tuning 14 or newer. Adaptive autovacuum is not supported on elastic clusters. [3][14][6] |
| Where it runs and what it collects | Self-hosted option: yes. Hosted by PostgresAI, or self-hosted in your own cloud account or on your own server. It collects database metadata such as statistics, normalized query texts and wait events, not table data or query parameters. | Self-hosted option: no. Part of Azure Database for PostgreSQL, which Microsoft describes as "a fully managed database service". Query Store and recommendations are stored in the azure_sys database on your server; Query Performance Insight and the troubleshooting guides also need logs sent to a Log Analytics workspace. [13][1][2][7] |
| Open source | Yes. The monitoring software is open source under Apache 2.0. Hosted plans are a separate paid service. | Does not apply. Does not apply: these tools are features of Azure Database for PostgreSQL, a Microsoft cloud service. [1][3] |
| Query performance analysis | Query analysis: yes. Top queries from pg_stat_statements by calls, execution time, planning time and rows, with a drill-down dashboard for a single query. For execution plans, Joe runs EXPLAIN on a DBLab clone. | Query analysis: yes. Query Store keeps runtime statistics in 15-minute windows by default, up to 500 queries per window, with optional query plans. Query Performance Insight shows long-running queries and top queries by calls, data usage, IOPS and temporary files. Query Store is opt-in, and Microsoft says not to enable it on the Burstable tier. [1][2] |
| Wait event analysis | Wait events: yes. An ASH-style wait event dashboard built from samples of pg_stat_activity. No extra extension is needed. | Wait events: yes. Query Store wait sampling records wait event type and name per query, sampled every 100 ms by default, and Query Performance Insight has a Wait Statistics tab. An enhanced metric counts sessions by wait event type. [1][2][8] |
| Health checks and recommendations | Health checks: yes. Scheduled checkup reports on settings, autovacuum and bloat, and indexes (invalid, unused, redundant). Each finding becomes an Issue with severity, evidence and a specific fix. | Health checks: yes. Autonomous tuning runs every 12 hours by default and recommends B-tree indexes, dropping duplicate or unused indexes, REINDEX, ANALYZE and VACUUM. You apply them yourself. It needs Query Store and at least 4 vCores. Troubleshooting guides cover CPU, memory, IOPS, temp files and autovacuum. [3][4][7] |
| AI and agent access | Agent access: yes. The postgresai CLI (alias pgai) and an MCP server with tools for Issues, action items and checkup reports. The setup guide covers Cursor, Claude Code, Windsurf and Codex. | Agent access: yes. The Azure MCP Server has PostgreSQL tools to list servers, databases and tables, run a query, get a table schema and get or set server parameters; it lists a GitHub Copilot subscription as a prerequisite. Recommendations are also available with az postgres flexible-server autonomous-tuning commands. [9][10][4] |
| Testing a fix before production | Test on a copy: yes. With DBLab Engine, a separate open-source product: a full-size thin clone of the database in seconds, where an index or query change can be run on real data. DBLab is set up and priced separately. | Test on a copy: partly. Autonomous tuning uses the hypopg extension to evaluate candidate indexes and reports the estimated plan cost improvement per query. The sources we reviewed do not describe running a change on a separate copy of the data. [3] |
| Human PostgreSQL experts | Human experts: yes. Scale includes two expert requests a month, answered within 24 business hours. Either plan can buy a one-off pack of two requests for $500. Consulting is separate. | Human experts: partly. Azure support plans from Developer ($29 a month) to Unified Enterprise, which includes advisory support, with Cloud Solution Architect services available. The sources we reviewed do not describe PostgreSQL-specific consulting. [11] |
| Alerts | Email and Slack alerts on Starter and Scale. | Azure Monitor alerts on platform, enhanced, autovacuum and availability metrics, and log query alerts in Log Analytics. [8] |
| History kept | 14 days on Starter, 13 months on Scale, custom on Enterprise. | Query Store: 7 days by default, 1 to 30 days. Metrics: up to 93 days. Autonomous tuning recommendations are deleted 35 days after they were last produced. Adaptive autovacuum audit records: 90 days. [1][8][3][6] |
| Security attestations | SOC 2 Type 2 examination completed for the Security and Availability criteria, covering March 4 to June 4, 2026. The SOC 3 report is public. | Microsoft states that Azure undergoes independent SOC 2 Type 2 audits; the list of services in scope is in the Azure SOC 2 Type 2 attestation report. [12] |

## When Azure PostgreSQL built-in tools is the better choice

- Built into the server: Query Store is available at no extra charge and troubleshooting guides cost nothing beyond the Log Analytics ingestion they need.
- Autonomous tuning recommends CREATE INDEX, dropping duplicate or unused indexes, REINDEX of invalid indexes, ANALYZE and VACUUM, each with a SQL statement; index recommendations include estimated size and query cost impact.
- Intelligent tuning and adaptive autovacuum change write and autovacuum parameters automatically; adaptive autovacuum records each change in an audit view.
- Query Store records wait samples every 100 ms by default and can store query plans, all queryable as views in the azure_sys database.
- The Azure MCP Server has PostgreSQL tools to list servers and tables, run queries, read table schemas and read or set server parameters.

## Pricing

| Product | Plan | List price | Notes |
|---|---|---|---|
| PostgresAI | Starter | $16 per cluster/month | Primary only, 14-day retention, no expert requests included |
| PostgresAI | Scale | $512 per cluster/month | Primary and up to 5 replicas in one cluster, 13-month retention, Grafana dashboards, 2 expert requests a month |
| PostgresAI | Enterprise | Custom | Contact sales |
| PostgresAI | Self-hosted | No licence fee | Open source under Apache 2.0; you run it yourself |
| Azure PostgreSQL built-in tools | Query Store | No extra charge | Opt-in; not recommended on the Burstable tier [1] |
| Azure PostgreSQL built-in tools | Troubleshooting guides | No extra charge | Beyond Log Analytics ingestion, which all guides need [7] |
| Azure PostgreSQL built-in tools | Embedded Grafana dashboards | No extra cost | Prebuilt dashboards in the Azure portal for Azure Monitor metrics [8] |

PostgresAI prices: https://postgres.ai/pricing. Logs sent to Log Analytics have ingestion, retention and query costs, and Query Performance Insight needs them. The sources we reviewed do not state a separate price for autonomous tuning, intelligent tuning or adaptive autovacuum.

## Using both

PostgresAI monitoring supports Azure Database for PostgreSQL, so it can run against the same server while Query Store, autonomous tuning and the troubleshooting guides stay on. Azure keeps its index and parameter tuning; PostgresAI adds scheduled checkups, Issues with a fix, 13 months of history on Scale and expert help.

## Questions

### Does Azure Database for PostgreSQL recommend indexes?

Yes. Autonomous tuning analyzes the Query Store workload and recommends B-tree indexes to create, duplicate or unused indexes to drop, and invalid indexes to reindex, with a SQL script for each. It also recommends ANALYZE and VACUUM. You run the scripts yourself. [3][4]

### What do the Azure tuning features need?

Query Store must be enabled with pg_qs.query_capture_mode set to top or all. Autonomous tuning needs at least 4 vCores and PostgreSQL 12 or newer. Query Performance Insight also needs wait sampling and a Log Analytics workspace. [1][2][3]

### Does Azure change PostgreSQL settings automatically?

Intelligent tuning adjusts bgwriter_delay, checkpoint_completion_target, max_wal_size and min_wal_size. Adaptive autovacuum, when enabled, tunes five autovacuum parameters every 30 minutes and records each change in an audit view. [5][6]

### How long does Query Store keep data?

7 days by default, configurable from 1 to 30 days with pg_qs.retention_period_in_days. Azure Monitor metrics are kept up to 93 days. [1][8]

### Can I use PostgresAI with Azure Database for PostgreSQL?

Yes. PostgresAI monitoring supports Azure Database for PostgreSQL, so it runs next to Query Store and autonomous tuning on the same server and adds checkups, Issues and expert help. [1]

## Sources for PostgresAI

- [PostgresAI monitoring overview](https://postgres.ai/docs/monitoring)
- [Pricing](https://postgres.ai/pricing)
- [DBLab Engine](https://postgres.ai/docs/database-lab)
- [DBLab compared with other ways to branch](https://postgres.ai/compare#branching)
- [postgresai repository](https://gitlab.com/postgres-ai/postgresai)
- [How much does it cost?](https://postgres.ai/docs/questions-and-answers)
- [Monitoring quick start](https://postgres.ai/docs/monitoring/getting-started)
- [Data privacy: metadata only](https://postgres.ai/docs/monitoring#data-privacy-metadata-only)
- [Query performance analysis dashboard](https://postgres.ai/docs/monitoring/dashboards/query-analysis)
- [Joe bot](https://postgres.ai/docs/joe-bot)
- [Wait event analysis dashboard](https://postgres.ai/docs/monitoring/dashboards/wait-events)
- [Checkup reports](https://postgres.ai/docs/checkup)
- [How to work with Issues](https://postgres.ai/docs/postgresai-howtos/how-to-work-with-issues)
- [How to install MCP for AI coding tools](https://postgres.ai/docs/postgresai-howtos/how-to-install-mcp)
- [PostgresAI CLI reference](https://postgres.ai/docs/reference-guides/postgresai-cli-reference)
- [Postgres consulting](https://postgres.ai/consulting)
- [Security and compliance](https://postgres.ai/security)

## Sources for Azure PostgreSQL built-in tools

1. [Azure Database for PostgreSQL: Query Store](https://learn.microsoft.com/en-us/azure/postgresql/monitor/concepts-query-store)
2. [Azure Database for PostgreSQL: Query Performance Insight](https://learn.microsoft.com/en-us/azure/postgresql/monitor/concepts-query-performance-insight)
3. [Azure Database for PostgreSQL: autonomous tuning](https://learn.microsoft.com/en-us/azure/postgresql/monitor/concepts-autonomous-tuning)
4. [Azure Database for PostgreSQL: use autonomous tuning recommendations](https://learn.microsoft.com/en-us/azure/postgresql/monitor/how-to-get-apply-recommendations-from-autonomous-tuning)
5. [Azure Database for PostgreSQL: intelligent tuning](https://learn.microsoft.com/en-us/azure/postgresql/monitor/concepts-intelligent-tuning)
6. [Azure Database for PostgreSQL: adaptive autovacuum](https://learn.microsoft.com/en-us/azure/postgresql/monitor/concepts-adaptive-autovacuum)
7. [Azure Database for PostgreSQL: troubleshooting guides](https://learn.microsoft.com/en-us/azure/postgresql/troubleshoot/concepts-troubleshooting-guides)
8. [Azure Database for PostgreSQL: monitor using metrics and logs](https://learn.microsoft.com/en-us/azure/postgresql/monitor/concepts-monitoring)
9. [Azure MCP Server tools for Azure Database for PostgreSQL](https://learn.microsoft.com/en-us/azure/developer/azure-mcp-server/tools/azure-database-postgresql)
10. [What is the Azure MCP Server?](https://learn.microsoft.com/en-us/azure/developer/azure-mcp-server/overview)
11. [Azure support plans](https://azure.microsoft.com/en-us/support/plans/)
12. [Azure compliance: SOC 2 Type 2](https://learn.microsoft.com/en-us/azure/compliance/offerings/offering-soc-2)
13. [What is Azure Database for PostgreSQL flexible server?](https://learn.microsoft.com/en-us/azure/postgresql/overview)
14. [Microsoft Learn: Supported versions of PostgreSQL in Azure Database for PostgreSQL](https://learn.microsoft.com/en-us/azure/postgresql/configure-maintain/concepts-supported-versions)

## How we compare

These pages compare what each product does for PostgreSQL; other databases and the rest of the stack are out of scope. What we say about the other product comes from its own documentation, pricing page, changelog or source repository, read on the date shown; each row cites its source. "Not documented" means we did not find it in those sources, not that the product cannot do it. Prices are list prices and the billing units differ, so they are not a total-cost comparison. Product names are trademarks of their owners.
