# PostgresAI > Zero drama Postgres. We fix Postgres trouble and keep it fixed: AI-native PostgreSQL monitoring, checkups, and thin-clone rehearsal before production. CLI: `npx postgresai@0.18.0` (check the current version with `npm view postgresai version`; `pgai` is the short alias). Use postgresai MCP/CLI with your AI agent. Create an organization at https://console.postgres.ai/addorg and choose “Set up with your AI agent” for SKILL.md instructions; see https://postgres.ai/docs/monitoring/getting-started. Raw markdown of every docs page is served under https://postgres.ai/raw/docs/ (the source path of the page). The full docs as one file: https://postgres.ai/llms-full.txt. Plans and list prices (details: https://postgres.ai/pricing): - PostgresAI Starter: $16 per cluster/month. Primary only, 14-day retention, no Grafana dashboards, no included expert requests. - 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 (24-business-hour response). - PostgresAI Enterprise: Custom. Contact sales. - PostgresAI Self-hosted: No license fee. Open source under Apache 2.0; you run it yourself. - DBLab Engine: Free. Open source, Apache 2.0; you run it. - DBLab SE: From $62/month. Billed hourly by machine size, plus your own cloud costs; 2,000 GiB limit; single user. - DBLab EE: Custom. Annual contract, from $0.2662 per 100 GiB per hour; unlimited database size, SSO. When to pick PostgresAI: - Open-source Apache 2.0 PostgreSQL monitoring (PG 14–18, 19 tested through RC1; 50 default metric groups / 57 defined with 9 PG 14–19 version-aware SQL groups, unified host_* metrics for RDS, Aurora, Supabase primary, and ClickHouse Managed Postgres, 16 pg_stat_statements columns incl. per-query WAL & planning + dM/dt, dM/dc, and checkup %M of collected workload per database (top 100 above collection thresholds; other = collected queries outside Top-N), and 15s-sampled ASH with vCPU-normalized AAS and honest CPU* wait-gap labels via gaps.wait.events). - Built for both humans and AI agents: daily checkups filed as tracked Issues, 16-tool MCP server for Issues/reports, CLI PromQL queries (`pgai promql`), 13-month Scale history, and 2 human Postgres expert requests/month on Scale. - Separate open-source DBLab Engine thin clones (Apache 2.0) to rehearse SQL, indexes, and schema migrations on full-size snapshots with DB Migration Checker lock checks before production. Limits: - Monitoring supports PostgreSQL 14 through 18 (PostgreSQL 19 tested through RC1; 19.0 GA validation in progress) and needs the pg_stat_statements extension; DBLab supports PostgreSQL 10 and newer. - Wait events are sampled from pg_stat_activity every 15 seconds (stored at 15s on Helm, 30s default scrape in Docker Compose — not 1-second or sub-second tracing), and historical baselines build over time after installation. - pg_stat_statements collection covers 16 core columns for the top 100 queries per database (calls >= 3, exec_time_total >= 1000 ms), and PostgresAI monitoring does not ingest PostgreSQL log files or collect production EXPLAIN plans. - Starter ($16 per cluster/month) covers the primary node only, keeps 14 days of history, and includes no Grafana dashboards and no included expert requests. Email and Slack messages are Issue notifications, not a real-time on-call pager. - Metadata-only monitoring has one default exception: one health check includes the first 500 characters of the raw xmin-horizon holder query, which can contain literals. Set postgresai.capture_query_preview=off to disable it. - DBLab SE is limited to 2,000 GiB per instance and a single user. All DBLab clones share one machine on copy-on-write storage, so timings on a clone should not be assumed to match production. - Managed services such as Amazon RDS are seeded to a separate DBLab host with dump and restore (first seeding takes about 1 TiB an hour) and refreshed in full in logical mode. ## Products - [PostgresAI monitoring](https://postgres.ai/docs/monitoring): AI-native PostgreSQL observability: monitoring, health checks, and root cause analysis, built for humans and AI agents. [Markdown](https://postgres.ai/raw/docs/monitoring/index.md) - [Postgres monitoring and daily checkup reports](https://postgres.ai/postgres-check): Continuous Postgres monitoring and daily checkup reports on Starter or Scale. Create a Console organization, review billing, and follow the getting-started guide. - [postgres-checkup](https://postgres.ai/docs/checkup): postgres-checkup – a powerful tool automating health checks of PostgreSQL databases. [Markdown](https://postgres.ai/raw/docs/checkup/index.md) - [pgTrue](https://pgtrue.postgres.ai/): Postgres articles, fact-checked claim by claim against the PostgreSQL source code. Every finding cites the source line or the test that settles it. - [DBLab Engine](https://postgres.ai/products/dblab_engine/): Fast thin database branching and cloning in seconds (after initial seeding) for compatible PostgreSQL 10+ databases, with fixed storage and compute costs for development, testing, and CI/CD. - [DBLab Engine documentation](https://postgres.ai/docs/database-lab): DBLab Engine – an open-source technology that is one of the core components of the DBLab / PostgresAI Platform, it implements instant cloning and database… [Markdown](https://postgres.ai/raw/docs/database-lab/index.md) - [DBLab Engine source code](https://github.com/postgres-ai/database-lab-engine): Open-source DBLab Engine repository on GitHub. - [Postgres how-tos](https://postgres.ai/docs/postgres-howtos/): How-to guides for PostgreSQL database management, optimization, and best practices. [Markdown](https://postgres.ai/raw/docs/postgres-howtos/index.md) - [Zero-downtime Postgres major upgrades](https://postgres.ai/products/postgres-ai-zdu): Physical-to-logical replication technique for zero-downtime, reversible, zero-data-loss Postgres major version upgrades, proven on multi-terabyte production clusters. - [Joe Bot](https://postgres.ai/products/joe): Joe Bot, a virtual DBA for SQL optimization. ## Company - [Pricing](https://postgres.ai/pricing): Plans (Starter, Scale, Enterprise) and the DBLab Engine add-on. - [Postgres consulting](https://postgres.ai/consulting): PostgresAI team help for fast-growing companies hitting Postgres bottlenecks (managed or self-managed). Contact: consulting@postgres.ai. - [Security and compliance](https://postgres.ai/security): The PostgresAI Platform has completed a SOC 2 Type 2 examination for the Security and Availability Trust Services Criteria. - [Contact PostgresAI](https://postgres.ai/contact): How to reach the PostgresAI team. ## Compare Side-by-side comparisons with other Postgres tools, checked between 2026-11-18 and 2026-11-26. Every table row, comparison point, price and competitor FAQ answer cites the other vendor's own documentation. Each page has a markdown twin under https://postgres.ai/raw/compare/. - [All comparisons](https://postgres.ai/compare): 64 comparisons, with a matrix for each kind of tool. [Markdown](https://postgres.ai/raw/compare/index.md) - [PostgresAI vs Datasentinel: open source ASH/CPU* vs 10s plans](https://postgres.ai/compare/postgresai-vs-datasentinel): Datasentinel samples sessions every 10 seconds with per-plan stats, on-premises or SaaS. PostgresAI is Apache 2.0 with ASH/CPU*, checkups and Issues. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-datasentinel.md) - [PostgresAI vs EDB Postgres Enterprise Manager: any provider vs EDB fleets](https://postgres.ai/compare/postgresai-vs-edb-postgres-enterprise-manager): EDB Postgres Enterprise Manager monitors Postgres from a pgAdmin-based console, each server under an EDB subscription. PostgresAI covers any server, at a list price. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-edb-postgres-enterprise-manager.md) - [PostgresAI vs pganalyze: open source vs plan and log insights](https://postgres.ai/compare/postgresai-vs-pganalyze): pganalyze collects auto_explain plans and logs with Index/Query Advisors. PostgresAI is open-source monitoring with ASH/CPU*, host_* stats and tracked Issues. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-pganalyze.md) - [PostgresAI vs pgCustard: ASH and MCP vs proactive email alerts](https://postgres.ai/compare/postgresai-vs-pgcustard): pgCustard (early access, 50 EUR/database/month) runs 30s Postgres checks and sends email alerts. PostgresAI brings wait-event ASH, MCP and separate DBLab. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-pgcustard.md) - [PostgresAI vs pgDash: open source with wait events vs pgmetrics reports](https://postgres.ai/compare/postgresai-vs-pgdash): pgDash monitors PostgreSQL from pgmetrics reports, as SaaS or self-hosted, with alerts. PostgresAI is open source and samples wait events from pg_stat_activity. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-pgdash.md) - [PostgresAI vs pgEdge AI DBA Workbench: human experts vs an AI assistant](https://postgres.ai/compare/postgresai-vs-pgedge-ai-dba-workbench): pgEdge AI DBA Workbench is open-source, self-hosted monitoring with an AI assistant. PostgresAI adds a wait event dashboard and PostgreSQL experts on Scale. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-pgedge-ai-dba-workbench.md) - [PostgresAI vs pgMustard: whole-database monitoring vs one plan at a time](https://postgres.ai/compare/postgresai-vs-pgmustard): pgMustard reviews one EXPLAIN ANALYZE plan at a time and scores tips by time saved. PostgresAI monitors the whole database and files findings as Issues with evidence. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-pgmustard.md) - [PostgresAI vs Percona PMM: wait events and clone tests vs QAN and Advisors](https://postgres.ai/compare/postgresai-vs-percona-pmm): Percona PMM is open-source, self-hosted monitoring with Query Analytics and Advisors. PostgresAI adds wait events, Issues, and separate DBLab clones to test fixes. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-percona-pmm.md) - [PostgresAI vs pgBadger: continuous monitoring vs log file reports](https://postgres.ai/compare/postgresai-vs-pgbadger): pgBadger is an open-source PostgreSQL log analyzer that builds HTML reports. PostgresAI monitors continuously with ASH/CPU*, checkups and Issues. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-pgbadger.md) - [PostgresAI vs PgHero: history and wait events vs a performance dashboard](https://postgres.ai/compare/postgresai-vs-pghero): PgHero is an open-source Postgres dashboard for slow queries and index hints. PostgresAI adds history, ASH/CPU*, bloat checkups and tracked Issues. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-pghero.md) - [PostgresAI vs pgMonitor: tracked Issues vs a Prometheus bundle](https://postgres.ai/compare/postgresai-vs-pgmonitor): pgMonitor is Crunchy Data's open-source Prometheus and Grafana bundle for PostgreSQL. PostgresAI adds ASH/CPU*, bloat checkups and tracked Issues on any provider. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-pgmonitor.md) - [PostgresAI vs pgwatch: checkups and Issues vs a metrics collector](https://postgres.ai/compare/postgresai-vs-pgwatch): pgwatch is an open-source PostgreSQL metrics collector where you wire storage and dashboards. PostgresAI adds turnkey dashboards, CPU* ASH, checkups and MCP. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-pgwatch.md) - [PostgresAI vs postgres_exporter and Grafana: Issues vs your own rules](https://postgres.ai/compare/postgresai-vs-prometheus-postgres-exporter): postgres_exporter, Prometheus and Grafana form a metrics stack you assemble yourself. PostgresAI pairs findings as Issues with evidence and keeps 13 months of history. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-prometheus-postgres-exporter.md) - [PostgresAI vs PoWA: managed Postgres too vs extensions on each server](https://postgres.ai/compare/postgresai-vs-powa): PoWA is an open-source PostgreSQL workload analyzer with per-query stats and HypoPG index suggestions. PostgresAI also covers managed services and has experts on Scale. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-powa.md) - [PostgresAI vs temBoard: managed Postgres too vs an agent on each host](https://postgres.ai/compare/postgresai-vs-temboard): temBoard by Dalibo is an open-source console to monitor, vacuum and configure PostgreSQL servers. PostgresAI also covers managed services such as Amazon RDS. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-temboard.md) - [PostgresAI vs Coroot: Postgres experts and history vs eBPF query capture](https://postgres.ai/compare/postgresai-vs-coroot): Coroot is open-source observability that captures Postgres queries via eBPF. PostgresAI adds PG 14-18 checkups, Issues, MCP and human experts. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-coroot.md) - [PostgresAI vs Datadog Database Monitoring: open source vs traced queries](https://postgres.ai/compare/postgresai-vs-datadog-database-monitoring): Datadog Database Monitoring ties Postgres queries, plans and waits to APM traces. PostgresAI is open source with ASH/CPU*, bloat checks and Issues. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-datadog-database-monitoring.md) - [PostgresAI vs Dynatrace: open-source monitoring vs an ActiveGate extension](https://postgres.ai/compare/postgresai-vs-dynatrace): Dynatrace monitors Postgres through an ActiveGate extension, with top statements and plans. PostgresAI is open-source Postgres monitoring with checkups and Issues. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-dynatrace.md) - [PostgresAI vs Foglight for PostgreSQL: open source vs workload drill-down](https://postgres.ai/compare/postgresai-vs-quest-foglight): Foglight monitors PostgreSQL with Performance Investigator, alarm rules and AI query tuning, on premises or as SaaS. PostgresAI is open source and publishes its prices. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-quest-foglight.md) - [PostgresAI vs Grafana Cloud Database Observability: checkups vs query data](https://postgres.ai/compare/postgresai-vs-grafana-cloud-database-observability): Grafana Cloud Database Observability collects Postgres query data linked to traces. PostgresAI is open source with PG 14-18 checkups, ASH/CPU* and Issues. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-grafana-cloud-database-observability.md) - [PostgresAI vs Netdata: wait events and experts vs per-second metrics](https://postgres.ai/compare/postgresai-vs-netdata): Netdata collects per-second PostgreSQL metrics with built-in alerts and ML anomaly scores. PostgresAI adds a wait event dashboard, Issues with evidence and next steps. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-netdata.md) - [PostgresAI vs New Relic: open source with experts vs queries tied to traces](https://postgres.ai/compare/postgresai-vs-new-relic): New Relic collects Postgres slow queries, wait events and plans and links them to app traces. PostgresAI is open source and gives AI agents its Issues over MCP. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-new-relic.md) - [PostgresAI vs Redgate Monitor: open source vs captured plans and alerts](https://postgres.ai/compare/postgresai-vs-redgate-monitor): Redgate Monitor watches PostgreSQL with auto_explain plans, top waits and alerts. PostgresAI is open source and covers Amazon RDS, which Redgate marks as preview. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-redgate-monitor.md) - [PostgresAI vs SolarWinds DPA: open source vs commercial wait-time analysis](https://postgres.ai/compare/postgresai-vs-solarwinds-dpa): SolarWinds DPA is self-hosted, agentless wait-time analysis with table and index advisors, sold by quote. PostgresAI is open source with a list price per cluster. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-solarwinds-dpa.md) - [PostgresAI vs Zabbix: Issues with evidence vs threshold triggers](https://postgres.ai/compare/postgresai-vs-zabbix): Zabbix is open-source monitoring with PostgreSQL templates and threshold triggers. PostgresAI adds ASH/CPU* wait events, bloat checkups and tracked Issues. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-zabbix.md) - [PostgresAI vs Amazon DevOps Guru for RDS: any cloud vs ML on RDS (closing)](https://postgres.ai/compare/postgresai-vs-devops-guru-for-rds): DevOps Guru for RDS finds anomalies in Aurora and RDS for PostgreSQL with ML and closed to new customers in October 2026. PostgresAI is open source, for any provider. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-devops-guru-for-rds.md) - [PostgresAI vs Azure PostgreSQL built-in tools: any provider vs Azure only](https://postgres.ai/compare/postgresai-vs-azure-database-for-postgresql): Azure Database for PostgreSQL includes Query Store and index advice. PostgresAI runs open-source checkups, ASH/CPU* and Issues on any provider. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-azure-database-for-postgresql.md) - [PostgresAI vs Cloud SQL Query Insights: any provider vs inside Cloud SQL](https://postgres.ai/compare/postgresai-vs-cloud-sql-query-insights): Cloud SQL Query Insights shows query load, plans and index advice inside Cloud SQL. PostgresAI adds open-source ASH/CPU*, bloat checks and Issues. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-cloud-sql-query-insights.md) - [PostgresAI vs CloudWatch Database Insights: any provider vs built into AWS](https://postgres.ai/compare/postgresai-vs-cloudwatch-database-insights): CloudWatch Database Insights shows DB load, top SQL and wait events for RDS and Aurora. PostgresAI is open source, runs on any provider and files findings as Issues. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-cloudwatch-database-insights.md) - [PostgresAI vs Supabase advisors: ASH and history vs built-in lints](https://postgres.ai/compare/postgresai-vs-supabase-advisors): Keep Supabase advisors on; add PostgresAI for historical query-linked wait events (ASH), derived pg_stat_statements metrics, 13-month Scale history and expert help. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-supabase-advisors.md) - [PostgresAI vs Tiger Data Insights: any provider vs built into Tiger Cloud](https://postgres.ai/compare/postgresai-vs-tiger-data-insights): Tiger Data Insights shows top queries, EXPLAIN plans and metrics in the Tiger Cloud Console. PostgresAI keeps 13 months of history on Scale and covers other providers. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-tiger-data-insights.md) - [PostgresAI vs DBtune: monitoring and checkups vs automated parameter tuning](https://postgres.ai/compare/postgresai-vs-dbtune): DBtune tunes PostgreSQL server parameters against your workload, automatically or with approval. PostgresAI monitors queries and waits and files findings as Issues. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-dbtune.md) - [PostgresAI vs EverSQL: any provider vs AI query rewrites on Aiven](https://postgres.ai/compare/postgresai-vs-eversql): EverSQL is now Aiven AI Database Optimizer, with index and rewrite advice inside Aiven for PostgreSQL. PostgresAI works on any provider with ASH/CPU* and Issues. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-eversql.md) - [PostgresAI vs OtterTune: open-source monitoring vs ML knob tuning (closed)](https://postgres.ai/compare/postgresai-vs-ottertune): OtterTune tuned PostgreSQL knobs on Amazon RDS and Aurora with ML until it shut down in June 2024. PostgresAI monitors Postgres on any provider, as open source. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-ottertune.md) - [PostgresAI vs Postgres MCP Pro: always-on monitoring vs an MCP server](https://postgres.ai/compare/postgresai-vs-postgres-mcp-pro): Postgres MCP Pro is an open-source MCP server with checks and hypopg tuning. PostgresAI monitors continuously; separate DBLab clones test indexes on real data. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-postgres-mcp-pro.md) - [PostgresAI vs Readyset RDST: server monitoring vs a desktop query agent](https://postgres.ai/compare/postgresai-vs-readyset-rdst): Readyset RDST is an open-source desktop agent that ranks slow-query fixes for PostgreSQL. PostgresAI keeps history on a server; separate DBLab clones test changes first. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-readyset-rdst.md) - [PostgresAI vs Releem: monitoring with history vs config tuning it applies](https://postgres.ai/compare/postgresai-vs-releem): Releem added PostgreSQL in 2026, with config changes it can apply and index suggestions. PostgresAI keeps 13 months of history on Scale, and its software is open source. [Markdown](https://postgres.ai/raw/compare/postgresai-vs-releem.md) - [DBLab vs Databricks Lakebase: PostgreSQL 10+ clones vs Lakebase branches](https://postgres.ai/compare/dblab-vs-databricks-lakebase): Databricks Lakebase is managed Postgres in a Databricks workspace, with copy-on-write branches. DBLab clones compatible PostgreSQL 10+ sources on a machine you control. [Markdown](https://postgres.ai/raw/compare/dblab-vs-databricks-lakebase.md) - [DBLab vs Neon: clones of PostgreSQL 10+ sources vs branches on Neon](https://postgres.ai/compare/dblab-vs-neon): Neon branches a database hosted on Neon, with copy-on-write storage and a compute per branch. DBLab clones compatible PostgreSQL 10+ sources on a machine you control. [Markdown](https://postgres.ai/raw/compare/dblab-vs-neon.md) - [DBLab vs PlanetScale: clones in seconds vs branches restored from backup](https://postgres.ai/compare/dblab-vs-planetscale): PlanetScale for Postgres branches are separate deployments, empty or restored from a backup. DBLab makes thin clones of PostgreSQL 10+ sources on a machine you run. [Markdown](https://postgres.ai/raw/compare/dblab-vs-planetscale.md) - [DBLab vs Supabase Branching: full-size copies vs preview branches](https://postgres.ai/compare/dblab-vs-supabase-branching): Supabase Branching makes preview branches (empty by default, or PITR Include data). DBLab runs repeatable thin clones of PostgreSQL 10+ sources on your own host. [Markdown](https://postgres.ai/raw/compare/dblab-vs-supabase-branching.md) - [DBLab vs Tiger Data: PostgreSQL 10+ clones vs Tiger Cloud forks](https://postgres.ai/compare/dblab-vs-tiger-data): Tiger Data forks a Tiger Cloud service, now or from a past point, with copy-on-write on free services. DBLab clones PostgreSQL 10+ sources on a machine you control. [Markdown](https://postgres.ai/raw/compare/dblab-vs-tiger-data.md) - [DBLab vs Vela: clones of PostgreSQL 10+ sources vs branches on Vela](https://postgres.ai/compare/dblab-vs-vela): Vela is a self-hosted Postgres platform that branches its own databases with copy-on-write NVMe storage. DBLab clones PostgreSQL 10+ sources on a machine you control. [Markdown](https://postgres.ai/raw/compare/dblab-vs-vela.md) - [DBLab vs Xata: thin clones on one machine vs a branching platform](https://postgres.ai/compare/dblab-vs-xata): Xata clones or streams an existing Postgres into its platform and branches it with copy-on-write. DBLab makes thin clones of PostgreSQL 10+ sources on one machine. [Markdown](https://postgres.ai/raw/compare/dblab-vs-xata.md) - [DBLab vs Ardent: self-hosted thin clones vs a replicated branch service](https://postgres.ai/compare/dblab-vs-ardent): Ardent replicates a Postgres database into a replica it runs and branches it in under 6 seconds. DBLab clones compatible PostgreSQL 10+ sources on a machine you control. [Markdown](https://postgres.ai/raw/compare/dblab-vs-ardent.md) - [DBLab vs Amazon Aurora cloning: PostgreSQL 10+ clones vs Aurora clusters](https://postgres.ai/compare/dblab-vs-aurora-cloning): Aurora cloning creates a new Aurora cluster sharing the source's storage pages, with its own DB instances. DBLab clones PostgreSQL 10+ sources on a machine you control. [Markdown](https://postgres.ai/raw/compare/dblab-vs-aurora-cloning.md) - [DBLab vs Amazon RDS Blue/Green Deployments: test clones vs a switchover](https://postgres.ai/compare/dblab-vs-rds-blue-green): RDS Blue/Green Deployments keep a synced staging copy of production for an upgrade, then switch over. DBLab serves writable clones of PostgreSQL 10+ sources. [Markdown](https://postgres.ai/raw/compare/dblab-vs-rds-blue-green.md) - [DBLab vs Amazon RDS snapshot restore: thin clones vs a new instance each](https://postgres.ai/compare/dblab-vs-rds-snapshot-restore): Restoring an RDS snapshot or point in time creates a new DB instance with its own storage, loaded from S3 in the background. DBLab serves thin clones from one machine. [Markdown](https://postgres.ai/raw/compare/dblab-vs-rds-snapshot-restore.md) - [DBLab vs Cloud SQL cloning: thin clones vs a new Cloud SQL instance](https://postgres.ai/compare/dblab-vs-cloud-sql-clone): Cloud SQL cloning creates a new, independent Cloud SQL instance from an existing one. DBLab serves thin clones of PostgreSQL 10+ sources from one machine you control. [Markdown](https://postgres.ai/raw/compare/dblab-vs-cloud-sql-clone.md) - [DBLab vs Delphix: open-source thin clones vs a test data platform](https://postgres.ai/compare/dblab-vs-delphix): Delphix provisions virtual PostgreSQL databases from a staging copy and adds masking and a control plane, priced by quote. DBLab is open-source thin cloning. [Markdown](https://postgres.ai/raw/compare/dblab-vs-delphix.md) - [DBLab vs Redgate Test Data Manager: Postgres clones vs mask and subset](https://postgres.ai/compare/dblab-vs-redgate-test-data-manager): Redgate Test Data Manager masks and subsets PostgreSQL databases; Redgate Clone makes clones from backups on Kubernetes. DBLab makes thin clones of PostgreSQL. [Markdown](https://postgres.ai/raw/compare/dblab-vs-redgate-test-data-manager.md) - [DBLab vs Snaplet: full-size clones vs seed and subset (closed 2024)](https://postgres.ai/compare/dblab-vs-snaplet): Snaplet shut down in 2024 and open-sourced Seed, Snapshot and Copycat under MIT. DBLab makes full-size thin clones of PostgreSQL with masking rules you define. [Markdown](https://postgres.ai/raw/compare/dblab-vs-snaplet.md) - [DBLab vs Tonic.ai: thin clones vs de-identified database copies](https://postgres.ai/compare/dblab-vs-tonic): Tonic Structural de-identifies, subsets and synthesizes a source database into a destination database. DBLab makes thin, writable clones of a PostgreSQL database. [Markdown](https://postgres.ai/raw/compare/dblab-vs-tonic.md) - [DBLab vs CREATE DATABASE ... TEMPLATE: thin clones vs in-server copies](https://postgres.ai/compare/dblab-vs-postgres-template-cloning): CREATE DATABASE ... TEMPLATE copies a database inside the same PostgreSQL server, built in and free. DBLab makes thin clones of a full database on its own machine. [Markdown](https://postgres.ai/raw/compare/dblab-vs-postgres-template-cloning.md) - [DBLab vs pg_dump and pg_restore: thin clones vs a full copy each time](https://postgres.ai/compare/dblab-vs-pg-dump-restore): pg_dump and pg_restore copy a PostgreSQL database in full and come with PostgreSQL. DBLab loads one copy, for managed services with these tools, then makes thin clones. [Markdown](https://postgres.ai/raw/compare/dblab-vs-pg-dump-restore.md) - [DBLab vs ZFS snapshots and clones: same copy-on-write, by hand or managed](https://postgres.ai/compare/dblab-vs-zfs-snapshots): ZFS snapshots and clones give free, writable copy-on-write copies of a PostgreSQL data directory by hand. DBLab uses ZFS or LVM underneath and manages the clones. [Markdown](https://postgres.ai/raw/compare/dblab-vs-zfs-snapshots.md) - [DBLab vs Atlas: run a change on real data vs plan and lint it](https://postgres.ai/compare/dblab-vs-atlas): Atlas plans, lints and applies schema changes as code, verified on an empty dev database. DBLab runs the result on a full-size clone and measures the locks it holds. [Markdown](https://postgres.ai/raw/compare/dblab-vs-atlas.md) - [DBLab vs Bytebase: test a change on real data, then deploy it](https://postgres.ai/compare/dblab-vs-bytebase): Bytebase reviews, approves and deploys database changes, PostgreSQL included. DBLab measures the locks a change holds on a full-size clone, not from the SQL text. [Markdown](https://postgres.ai/raw/compare/dblab-vs-bytebase.md) - [DBLab vs Flyway: test on a full-size clone, deploy with migrations](https://postgres.ai/compare/dblab-vs-flyway): Flyway by Redgate applies versioned SQL migrations, with undo and drift checks in paid editions. DBLab runs them on a full-size clone and resets it for the next run. [Markdown](https://postgres.ai/raw/compare/dblab-vs-flyway.md) - [DBLab vs Liquibase: run a change on a clone, ship it with changelogs](https://postgres.ai/compare/dblab-vs-liquibase): Liquibase tracks, versions and deploys schema changes from changelogs. DBLab, open source under Apache 2.0, runs the changelog on a full-size clone first. [Markdown](https://postgres.ai/raw/compare/dblab-vs-liquibase.md) - [DBLab vs pg-schema-diff: plan an online change, then run it on a clone](https://postgres.ai/compare/dblab-vs-pg-schema-diff): pg-schema-diff by Stripe diffs a target schema against PostgreSQL and plans online DDL with hazards. DBLab runs the plan on a full-size clone and measures its locks. [Markdown](https://postgres.ai/raw/compare/dblab-vs-pg-schema-diff.md) - [DBLab vs pgroll: test a change on a clone, then roll it out](https://postgres.ai/compare/dblab-vs-pgroll): pgroll applies reversible PostgreSQL schema changes with expand/contract. DBLab measures a migration's locks on a full-size clone and can reset it for a rerun. [Markdown](https://postgres.ai/raw/compare/dblab-vs-pgroll.md) - [DBLab vs Sqitch: deploy and revert scripts, tested on a clone](https://postgres.ai/compare/dblab-vs-sqitch): Sqitch deploys, verifies and reverts SQL change scripts in dependency order. DBLab gives the deploy real data on a full-size clone, and reset restores it for a rerun. [Markdown](https://postgres.ai/raw/compare/dblab-vs-sqitch.md) - [DBLab vs Squawk: lint migration SQL, then run it on a clone](https://postgres.ai/compare/dblab-vs-squawk): Squawk lints PostgreSQL migration files for statements that take risky locks. DBLab executes the migration on a full-size clone and fails it if a lock is held too long. [Markdown](https://postgres.ai/raw/compare/dblab-vs-squawk.md) ## Docs: overview - [PostgresAI documentation](https://postgres.ai/docs/): Postgres experts, monitoring, and database branching. Find the problem, test the change on a copy of your data, and review the evidence before production. [Markdown](https://postgres.ai/raw/docs/get-started.md) - [Database Lab feature matrix](https://postgres.ai/docs/all-features): Database Lab by Postgres.ai – the full list of features. [Markdown](https://postgres.ai/raw/docs/all-features.md) - [Questions & answers](https://postgres.ai/docs/questions-and-answers): Slow queries, incidents, major upgrades and growth: PostgresAI combines monitoring, expert help and database branching to address Postgres trouble. [Markdown](https://postgres.ai/raw/docs/questions-and-answers.md) ## Docs: PostgresAI how-tos - [How to install MCP for AI coding tools](https://postgres.ai/docs/postgresai-howtos/how-to-install-mcp): Install MCP integration for Cursor, Claude Code, Windsurf, and Codex. [Markdown](https://postgres.ai/raw/docs/postgresai-howtos/how-to-install-mcp.md) - [How to work with Issues](https://postgres.ai/docs/postgresai-howtos/how-to-work-with-issues): View, manage, and resolve issue reports in PostgresAI Console. [Markdown](https://postgres.ai/raw/docs/postgresai-howtos/how-to-work-with-issues.md) - [Install PostgresAI monitoring](https://postgres.ai/docs/postgresai-howtos/install-postgres-ai-monitoring-from-postgresai-console): How to install PostgresAI monitoring using the PostgresAI Console at console.postgres.ai. [Markdown](https://postgres.ai/raw/docs/postgresai-howtos/install-postgres-ai-monitoring-from-postgresai-console.md) - [Run Joe from the CLI (pgai joe)](https://postgres.ai/docs/postgresai-howtos/joe-cli): Use pgai joe to get query plans, real EXPLAIN ANALYZE results, and test index ideas on ephemeral DBLab clones — right from your terminal. [Markdown](https://postgres.ai/raw/docs/postgresai-howtos/joe-cli.md) - [PostgresAI CLI](https://postgres.ai/docs/postgresai-howtos/postgresai-cli): Install and use postgresai CLI for authentication, MCP integration, and issues management. [Markdown](https://postgres.ai/raw/docs/postgresai-howtos/postgresai-cli.md) ## Docs: PostgresAI monitoring - [PostgresAI monitoring overview](https://postgres.ai/docs/monitoring): PostgresAI monitoring documentation: install paths, architecture, collected metrics, dashboards, data privacy, and supported Postgres versions. [Markdown](https://postgres.ai/raw/docs/monitoring/index.md) - [Advanced topics](https://postgres.ai/docs/monitoring/advanced/): Advanced configuration and integration guides for PostgresAI monitoring. [Markdown](https://postgres.ai/raw/docs/monitoring/advanced/index.md) - [Architecture](https://postgres.ai/docs/monitoring/advanced/architecture): Deep-dive into PostgresAI monitoring system components and data flow. [Markdown](https://postgres.ai/raw/docs/monitoring/advanced/architecture.md) - [Multi-cluster monitoring](https://postgres.ai/docs/monitoring/advanced/multi-cluster): Centralized monitoring for multiple PostgreSQL clusters from a single Grafana instance. [Markdown](https://postgres.ai/raw/docs/monitoring/advanced/multi-cluster.md) - [Monitoring security](https://postgres.ai/docs/monitoring/advanced/security): Security model and hardening options for the self-hosted monitoring stack. Several of these were added or made required in 0.15. [Markdown](https://postgres.ai/raw/docs/monitoring/advanced/security.md) - [Monitoring telemetry](https://postgres.ai/docs/monitoring/advanced/telemetry): New in 0.15. Self-hosted monitoring instances include an optional telemetry reporter that periodically sends a small operational health snapshot of the… [Markdown](https://postgres.ai/raw/docs/monitoring/advanced/telemetry.md) - [Configuration](https://postgres.ai/docs/monitoring/configuration/): Configuration guides for customizing PostgresAI monitoring components. [Markdown](https://postgres.ai/raw/docs/monitoring/configuration/index.md) - [Alerting configuration](https://postgres.ai/docs/monitoring/configuration/alerting): PostgresAI monitoring 0.18.0 does not ship any alert rules or an Alertmanager service. [Markdown](https://postgres.ai/raw/docs/monitoring/configuration/alerting.md) - [Grafana configuration](https://postgres.ai/docs/monitoring/configuration/grafana-config): Configuration for Grafana dashboards and visualization. [Markdown](https://postgres.ai/raw/docs/monitoring/configuration/grafana-config.md) - [pgwatch configuration](https://postgres.ai/docs/monitoring/configuration/pgwatch-config): Configuration options for the pgwatch metrics collectors. [Markdown](https://postgres.ai/raw/docs/monitoring/configuration/pgwatch-config.md) - [Prometheus/VictoriaMetrics configuration](https://postgres.ai/docs/monitoring/configuration/prometheus-config): Configuration for the time-series database storing monitoring metrics. [Markdown](https://postgres.ai/raw/docs/monitoring/configuration/prometheus-config.md) - [Dashboard overview](https://postgres.ai/docs/monitoring/dashboards/): PostgresAI monitoring includes 15 pre-built Grafana dashboards designed for expert-level PostgreSQL troubleshooting. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/index.md) - [07. Autovacuum and xmin horizon](https://postgres.ai/docs/monitoring/dashboards/autovacuum): Monitor autovacuum activity, transaction ID / MultiXID wraparound risk, and — new in 0.15 — the xmin horizon: how far back the oldest snapshot reaches and… [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/07-autovacuum.md) - [05. WAL, backups, DR](https://postgres.ai/docs/monitoring/dashboards/backups): Monitor backup status, WAL archiving, and disaster recovery readiness. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/05-backups.md) - [99. Host stats (RDS, Aurora, Supabase, ClickHouse)](https://postgres.ai/docs/monitoring/dashboards/host-stats): Unified host-level CPU, memory, storage, disk I/O, and network telemetry for supported managed PostgreSQL providers, normalized under a single host_* metric… [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/99-host-stats.md) - [10. Aggregated index analysis](https://postgres.ai/docs/monitoring/dashboards/index-health): Overview of index health, usage, and efficiency across all indexes. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/10-index-health.md) - [14. I/O statistics (pg_stat_io)](https://postgres.ai/docs/monitoring/dashboards/io-statistics): New in 0.15. Monitor PostgreSQL I/O activity broken down by backend type using the pg_stat_io view. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/14-io-statistics.md) - [13. Lock contention](https://postgres.ai/docs/monitoring/dashboards/lock-contention): Monitor lock waits and identify blocking chains. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/13-lock-contention.md) - [01. Single node performance overview (high level)](https://postgres.ai/docs/monitoring/dashboards/node-overview): High-level dashboard for quick triage and overall database health assessment. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/01-node-overview.md) - [02. Query performance analysis (top-N)](https://postgres.ai/docs/monitoring/dashboards/query-analysis): Comprehensive query performance dashboard showing top queries by various metrics. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/02-query-analysis.md) - [06. Replication](https://postgres.ai/docs/monitoring/dashboards/replication): Monitor streaming replication, replication lag, and high availability status. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/06-replication.md) - [Self-monitoring](https://postgres.ai/docs/monitoring/dashboards/self-monitoring): Monitor the health of the monitoring stack itself. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/self-monitoring.md) - [11. Single index analysis](https://postgres.ai/docs/monitoring/dashboards/single-index): Detailed analysis of a specific index's usage and health. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/11-single-index.md) - [03. Single queryid analysis](https://postgres.ai/docs/monitoring/dashboards/single-query): Detailed analysis of a specific query identified by its queryid. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/03-single-query.md) - [09. Single table analysis](https://postgres.ai/docs/monitoring/dashboards/single-table): Detailed analysis of a specific table's performance and health metrics. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/09-single-table.md) - [12. SLRU cache stats](https://postgres.ai/docs/monitoring/dashboards/slru): Monitor Simple LRU (SLRU) cache performance for PostgreSQL internal structures. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/12-slru.md) - [08. Aggregated table analysis](https://postgres.ai/docs/monitoring/dashboards/table-stats): Overview of table-level metrics across all tables in the database. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/08-table-stats.md) - [04. Wait event analysis (Active Session History)](https://postgres.ai/docs/monitoring/dashboards/wait-events): Active Session History (ASH) style dashboard for deep wait event analysis. [Markdown](https://postgres.ai/raw/docs/monitoring/dashboards/04-wait-events.md) - [Quick start](https://postgres.ai/docs/monitoring/getting-started/): Get PostgresAI monitoring running in minutes with PostgresAI Cloud. [Markdown](https://postgres.ai/raw/docs/monitoring/getting-started/index.md) - [CLI installation](https://postgres.ai/docs/monitoring/getting-started/installation-cli): The fastest way to get PostgresAI monitoring running locally. [Markdown](https://postgres.ai/raw/docs/monitoring/getting-started/installation-cli.md) - [Cloud installation](https://postgres.ai/docs/monitoring/getting-started/installation-cloud): Configure PostgresAI monitoring for managed PostgreSQL services. [Markdown](https://postgres.ai/raw/docs/monitoring/getting-started/installation-cloud.md) - [Docker Compose installation](https://postgres.ai/docs/monitoring/getting-started/installation-docker): For custom deployments and development environments. [Markdown](https://postgres.ai/raw/docs/monitoring/getting-started/installation-docker.md) - [Helm installation](https://postgres.ai/docs/monitoring/getting-started/installation-helm): The Helm chart is open source (Apache 2.0) and self-service: install it yourself with the procedure below, no plan needed. [Markdown](https://postgres.ai/raw/docs/monitoring/getting-started/installation-helm.md) - [Quick start for Amazon RDS over AWS PrivateLink](https://postgres.ai/docs/monitoring/getting-started/quickstart-rds-privatelink): Set up PostgresAI monitoring for a private Amazon RDS database — one that has no public endpoint — using the guided setup in PostgresAI Console. [Markdown](https://postgres.ai/raw/docs/monitoring/getting-started/quickstart-rds-privatelink.md) - [Quick start for Supabase](https://postgres.ai/docs/monitoring/getting-started/quickstart-supabase): Set up PostgresAI monitoring for your Supabase databases using the built-in Supabase integration in PostgresAI Console. [Markdown](https://postgres.ai/raw/docs/monitoring/getting-started/quickstart-supabase.md) - [System requirements](https://postgres.ai/docs/monitoring/getting-started/requirements): The I/O statistics dashboard (14) and the pg_stat_io metric group require PostgreSQL 16 or newer (pg_stat_io was introduced in PG16). [Markdown](https://postgres.ai/raw/docs/monitoring/getting-started/requirements.md) - [Upgrading the monitoring stack](https://postgres.ai/docs/monitoring/getting-started/upgrade): This page covers upgrading an existing self-hosted monitoring stack to a newer PostgresAI release (for example, from 0.16.x to 0.17.0). [Markdown](https://postgres.ai/raw/docs/monitoring/getting-started/upgrade.md) - [Metrics reference](https://postgres.ai/docs/monitoring/metrics/): Reference documentation for all metrics collected by PostgresAI monitoring. [Markdown](https://postgres.ai/raw/docs/monitoring/metrics/index.md) - [Index metrics](https://postgres.ai/docs/monitoring/metrics/index-metrics): Index usage and health metrics. In this stack the usage metric reads pg_stat_all_indexes (not pg_stat_user_indexes) and the I/O metric reads… [Markdown](https://postgres.ai/raw/docs/monitoring/metrics/index-metrics.md) - [pg_stat_statements metrics](https://postgres.ai/docs/monitoring/metrics/pg-stat-statements): Query-level performance metrics from the pg_stat_statements extension. [Markdown](https://postgres.ai/raw/docs/monitoring/metrics/pg-stat-statements.md) - [Database- and cluster-level metrics](https://postgres.ai/docs/monitoring/metrics/system-metrics): PostgreSQL system-level metrics. In this stack they are exported by the db_stats, bgwriter, archive_lag / pg_archiver, pg_stat_replication, and settings… [Markdown](https://postgres.ai/raw/docs/monitoring/metrics/system-metrics.md) - [Table metrics](https://postgres.ai/docs/monitoring/metrics/table-metrics): Table-level statistics. In this stack they come from the table_stats metric group, whose query reads pg_stat_all_tables (not pg_stat_user_tables). [Markdown](https://postgres.ai/raw/docs/monitoring/metrics/table-metrics.md) - [Wait event metrics](https://postgres.ai/docs/monitoring/metrics/wait-events): Active session history and wait event metrics from pg_stat_activity. [Markdown](https://postgres.ai/raw/docs/monitoring/metrics/wait-events.md) - [Troubleshooting](https://postgres.ai/docs/monitoring/troubleshooting/): Guides for diagnosing and resolving common PostgresAI monitoring issues. [Markdown](https://postgres.ai/raw/docs/monitoring/troubleshooting/index.md) - [No data troubleshooting](https://postgres.ai/docs/monitoring/troubleshooting/no-data): Diagnosing and fixing "No data" issues in PostgresAI dashboards. [Markdown](https://postgres.ai/raw/docs/monitoring/troubleshooting/no-data.md) - [Performance tuning](https://postgres.ai/docs/monitoring/troubleshooting/performance): Optimizing PostgresAI monitoring for better performance and lower resource usage. [Markdown](https://postgres.ai/raw/docs/monitoring/troubleshooting/performance.md) - [Permission errors](https://postgres.ai/docs/monitoring/troubleshooting/permissions): Resolving access denied and permission issues in PostgresAI monitoring. [Markdown](https://postgres.ai/raw/docs/monitoring/troubleshooting/permissions.md) ## Docs: checkup - [Overview of postgres-checkup](https://postgres.ai/docs/checkup): postgres-checkup – a powerful tool automating health checks of PostgreSQL databases. [Markdown](https://postgres.ai/raw/docs/checkup/index.md) ## Docs: PostgresAI platform - [DBLab Platform overview](https://postgres.ai/docs/platform): DBLab Platform is a unified solution that helps developers, DBAs, SREs, and QA engineers boost their work with PostgreSQL databases. [Markdown](https://postgres.ai/raw/docs/platform/index.md) - [DBLab Platform security](https://postgres.ai/docs/platform/security): DBLab Platform and its components are developed with a strong focus on security. To ensure that your data is secure, please carefully read this document. [Markdown](https://postgres.ai/raw/docs/platform/security.md) - [3rd-party data subprocessors and service providers](https://postgres.ai/docs/platform/service-providers): Postgres.ai aims to be fully transparent regarding how your data is used, how it is collected, and with whom it can be shared. [Markdown](https://postgres.ai/raw/docs/platform/service-providers.md) ## Docs: DBLab Engine - [DBLab Engine](https://postgres.ai/docs/database-lab): DBLab Engine – an open-source technology that is one of the core components of the DBLab / PostgresAI Platform, it implements instant cloning and database… [Markdown](https://postgres.ai/raw/docs/database-lab/index.md) - [DB Migration Checker](https://postgres.ai/docs/database-lab/db-migration-checker): Automatically test DB migrations (DDL, DML) in CI/CD pipelines [Markdown](https://postgres.ai/raw/docs/database-lab/db-migration-checker.md) - [Database Lab data masking and obfuscation](https://postgres.ai/docs/database-lab/masking): Strategies for data anonymization of PostgreSQL databases – build secure non-production environments. [Markdown](https://postgres.ai/raw/docs/database-lab/masking.md) - [Prometheus monitoring](https://postgres.ai/docs/database-lab/prometheus-monitoring): DBLab Engine exposes Prometheus metrics via the /metrics endpoint. These metrics can be used to monitor the health and performance of the DBLab instance. [Markdown](https://postgres.ai/raw/docs/database-lab/prometheus-monitoring.md) - [PostgreSQL versions and extensions supported in DBLab Engine](https://postgres.ai/docs/database-lab/supported-databases): Currently, DBLab Engine fully supports the following PostgreSQL major versions: [Markdown](https://postgres.ai/raw/docs/database-lab/supported-databases.md) - [Telemetry](https://postgres.ai/docs/database-lab/telemetry): Telemetry collected by DBLab Engine and how to control it [Markdown](https://postgres.ai/raw/docs/database-lab/telemetry.md) - [Query duration difference between Database Lab and production environments](https://postgres.ai/docs/database-lab/timing-estimator): Why there is a difference in query duration between Database Lab and production environments? How to deal with it? What other parameters could be used for the SQL optimization process? [Markdown](https://postgres.ai/raw/docs/database-lab/timing-estimator.md) - [DBLab Engine user interface](https://postgres.ai/docs/database-lab/user-interface): Embedded visual interface for interacting with DBLab Engine [Markdown](https://postgres.ai/raw/docs/database-lab/user-interface.md) ## Docs: DBLab how-tos - [DBLab how-to guides](https://postgres.ai/docs/dblab-howtos): Step-by-step DBLab how-to guides for installing DBLab Engine, cloning and branching Postgres databases, managing snapshots, using Joe bot, and more. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/index.md) - [DBLab Engine administration](https://postgres.ai/docs/dblab-howtos/administration): Guides for installing, configuring, securing, and maintaining DBLab Engine, managing Joe Bot, and refreshing data for Postgres environments. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/index.md) - [How to add disk space to a ZFS pool without downtime](https://postgres.ai/docs/dblab-howtos/administration/add-disk-space-to-zfs-pool): Expand a ZFS pool used by DBLab Engine online, with no downtime, by resizing the cloud disk and enabling ZFS autoexpand on Linux. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/add-disk-space-to-zfs-pool.md) - [Masking sensitive data in PostgreSQL logs when using CI Observer](https://postgres.ai/docs/dblab-howtos/administration/ci-observer-postgres-log-masking): Learn how to configure CI Observer to mask sensitive data in PostgreSQL logs before saving them in Platform's centralized storage [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/ci-observer-postgres-log-masking.md) - [DBLab data sources](https://postgres.ai/docs/dblab-howtos/administration/data): Overview of DBLab Engine data retrieval methods, comparing logical (dump/restore) and physical data sources for thin cloning of Postgres databases. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/data/index.md) - [Data source: Custom](https://postgres.ai/docs/dblab-howtos/administration/data/custom): Configure DBLab Engine to load data with any Postgres backup tool, such as pg_basebackup, Barman, or pgBackRest, using a custom physical restore command. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/data/custom.md) - [Rename databases during snapshot creation](https://postgres.ai/docs/dblab-howtos/administration/data/database-rename): Use the databaseRename option in DBLab Engine to expose different database names in clones than in the source, for logical and physical snapshots. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/data/database-rename.md) - [Data source: pg_dump](https://postgres.ai/docs/dblab-howtos/administration/data/dump): Set up DBLab Engine to load data with pg_dump and pg_restore, including multi-database dumps, plain-text and compressed dumps, and direct restore. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/data/dump.md) - [Data source: pg_basebackup](https://postgres.ai/docs/dblab-howtos/administration/data/pg_basebackup): Configure DBLab Engine to build a physical data directory from a Postgres source using pg_basebackup as a custom physical restore tool. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/data/pg_basebackup.md) - [Data source: pgBackRest](https://postgres.ai/docs/dblab-howtos/administration/data/pgbackrest): Configure DBLab Engine to restore a Postgres data directory from a pgBackRest repository, including stanza, delta restore, and repository settings. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/data/pgbackrest.md) - [Data source: AWS RDS](https://postgres.ai/docs/dblab-howtos/administration/data/rds): Connect DBLab Engine to an Amazon RDS Postgres database using either master password authentication or IAM database authentication. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/data/rds.md) - [Data source: RDS/Aurora refresh](https://postgres.ai/docs/dblab-howtos/administration/data/rds-refresh): Refresh DBLab Engine from Amazon RDS or Aurora by dumping a temporary RDS clone instead of production, avoiding xmin horizon holds, load, and bloat. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/data/rds-refresh.md) - [Data source: rsync](https://postgres.ai/docs/dblab-howtos/administration/data/rsync): Configure DBLab Engine to build a physical Postgres data directory from a source or WAL archive using rsync as a custom physical restore command. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/data/rsync.md) - [Data source: WAL-G](https://postgres.ai/docs/dblab-howtos/administration/data/wal-g): Configure DBLab Engine to restore a physical Postgres data directory from a WAL-G backup archive, using WAL-G environment variables and settings. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/data/wal-g.md) - [How to manage DBLab Engine](https://postgres.ai/docs/dblab-howtos/administration/engine-manage): Learn how to configure and maintain DBLab Engine instances to build powerful non-production environments for PostgreSQL. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/engine-manage.md) - [Secure DBLab Engine](https://postgres.ai/docs/dblab-howtos/administration/engine-secure): Secure the DBLab Engine UI, API, CLI, and database clones with an Envoy proxy and a Let's Encrypt SSL certificate for encrypted HTTPS access. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/engine-secure.md) - [How to install Database Lab with Terraform on AWS](https://postgres.ai/docs/dblab-howtos/administration/install-database-lab-with-terraform): Terraform is no longer supported for installing DBLab Engine. Use the PostgresAI Console or the AWS Marketplace to install DBLab instead. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/install-database-lab-with-terraform.md) - [How to install DBLab using the AWS Marketplace](https://postgres.ai/docs/dblab-howtos/administration/install-dle-from-aws-marketplace): Install DBLab Engine from the AWS Marketplace to get instant database branching and thin clones for RDS, RDS Aurora, and any Postgres source. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/install-dle-from-aws-marketplace.md) - [How to install DBLab using the PostgresAI Console](https://postgres.ai/docs/dblab-howtos/administration/install-dle-from-postgres-ai): Install DBLab Standard Edition in your own cloud or on-premises infrastructure in minutes using the PostgresAI Console, with vendor support included. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/install-dle-from-postgres-ai.md) - [How to install DBLab manually](https://postgres.ai/docs/dblab-howtos/administration/install-dle-manually): Step-by-step guide to manually install DBLab Engine Community Edition on Ubuntu with Docker and ZFS or LVM for thin cloning of Postgres databases. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/install-dle-manually.md) - [How to manage Joe Bot](https://postgres.ai/docs/dblab-howtos/administration/joe-manage): Start, reconfigure, upgrade, and monitor the Joe Bot container for SQL optimization on DBLab Engine clones, and check its status and logs. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/joe-manage.md) - [How to refresh data when working in the "logical" mode](https://postgres.ai/docs/dblab-howtos/administration/logical-full-refresh): How to fully refresh data in DBLab Engine when using the "logical" provisioning mode, both manually on a single disk and automatically without downtime. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/logical-full-refresh.md) - [How to configure PostgreSQL used by DBLab Engine](https://postgres.ai/docs/dblab-howtos/administration/postgresql-configuration): How to configure Postgres instances managed by DBLab Engine, including shared_buffers, work_mem, and query planning settings for accurate clones. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/postgresql-configuration.md) - [How to run DBLab Engine on macOS](https://postgres.ai/docs/dblab-howtos/administration/run-database-lab-on-mac): Run DBLab Engine 4.1+ with full ZFS support on Intel or Apple Silicon macOS using Colima, a lightweight Linux VM with Docker. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/run-database-lab-on-mac.md) - [Teleport integration](https://postgres.ai/docs/dblab-howtos/administration/teleport-integration): Integrate DBLab Engine 4.1+ with Teleport for secure, audited, certificate-based access to Postgres database clones with role-based access control, including per-user clone access and custom resource labels (4.2+). [Markdown](https://postgres.ai/raw/docs/dblab-howtos/administration/teleport-integration.md) - [How to work with database branches](https://postgres.ai/docs/dblab-howtos/branching): Guides for working with database branches in DBLab Engine, including how to create and delete branches and build preview environments with Coolify. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/branching/index.md) - [How to create a database branch](https://postgres.ai/docs/dblab-howtos/branching/create-branch): Create a database branch in DBLab Engine from the GUI or the dblab CLI, including branching from a specific parent branch or snapshot ID. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/branching/create-branch.md) - [How to delete a database branch](https://postgres.ai/docs/dblab-howtos/branching/delete-branch): Delete a database branch in DBLab Engine from the GUI, the dblab branch command, or the API; protect a branch from deletion or let the retention policy expire unused branches automatically (DBLab Engine 4.2+). [Markdown](https://postgres.ai/raw/docs/dblab-howtos/branching/delete-branch.md) - [How to set up full-stack preview environments with DBLab, Coolify and GitHub](https://postgres.ai/docs/dblab-howtos/branching/preview-environments-with-dblab-and-coolify): Set up automated full-stack preview environments that provision an isolated Postgres clone with DBLab and deploy with Coolify for every GitHub pull request. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/branching/preview-environments-with-dblab-and-coolify.md) - [How to work with DBLab CLI](https://postgres.ai/docs/dblab-howtos/cli): Guides for working with the DBLab CLI, including how to install and initialize the dblab client to manage clones and branches from the command line. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/cli/index.md) - [How to install and initialize DBLab CLI](https://postgres.ai/docs/dblab-howtos/cli/cli-install-init): Install the DBLab CLI, optionally connect over an SSH tunnel, and initialize it with your instance URL and token to run dblab commands against DBLab Engine. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/cli/cli-install-init.md) - [How to work with DBLab clones](https://postgres.ai/docs/dblab-howtos/cloning): Guides for working with DBLab clones, including how to create, connect to, reset, destroy, protect, and run a Postgres major upgrade in a clone. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/cloning/index.md) - [Protect clones from manual and automatic deletion](https://postgres.ai/docs/dblab-howtos/cloning/clone-protection): Protect DBLab clones from manual and automatic deletion, including time-limited protection leases in DBLab Engine 4.1+, from the GUI, CLI, or API. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/cloning/clone-protection.md) - [How to perform a Postgres major upgrade in a DBLab clone](https://postgres.ai/docs/dblab-howtos/cloning/clone-upgrade): Upgrade a single DBLab clone to a newer Postgres major version with one command (dblab clone upgrade, the UI, or the API) to rehearse a production upgrade on real data. DBLab Engine 4.2+. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/cloning/clone-upgrade.md) - [How to connect to a DBLab clone](https://postgres.ai/docs/dblab-howtos/cloning/connect-clone): Connect to a DBLab clone with psql or JDBC, directly or over SSH port forwarding, using the connection info from the GUI or the dblab clone status command. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/cloning/connect-clone.md) - [How to create a DBLab clone](https://postgres.ai/docs/dblab-howtos/cloning/create-clone): Create a thin DBLab clone from the GUI or the dblab CLI, including choosing a snapshot or branch, protecting the clone, and setting extra Postgres config. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/cloning/create-clone.md) - [How to destroy a DBLab clone](https://postgres.ai/docs/dblab-howtos/cloning/destroy-clone): Destroy a DBLab clone from the GUI or with the dblab clone destroy command, synchronously or asynchronously, to free up disk space when work is done. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/cloning/destroy-clone.md) - [How to reset a DBLab clone's state](https://postgres.ai/docs/dblab-howtos/cloning/reset-clone): Reset a DBLab clone to its initial snapshot state from the web UI or the DBLab CLI, discarding all changes made during testing on the clone. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/cloning/reset-clone.md) - [How to work with Joe chatbot](https://postgres.ai/docs/dblab-howtos/joe-bot): How-to guides for Joe bot: get Postgres EXPLAIN plans, create indexes, reset sessions, manage long-running queries, and work with SQL optimization history. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/joe-bot/index.md) - [How to get row counts for arbitrary SELECTs](https://postgres.ai/docs/dblab-howtos/joe-bot/count-rows): Use Joe bot and EXPLAIN with actual execution to get exact row counts for any SELECT on production-like data, without direct access to the source database. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/joe-bot/count-rows.md) - [How to create an index using Joe bot](https://postgres.ai/docs/dblab-howtos/joe-bot/create-index): Create indexes and change the database schema safely with Joe bot's exec command on independent Postgres clones, including HypoPG hypothetical indexes. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/joe-bot/create-index.md) - [How to get sizes of PostgreSQL databases, tables, and indexes with psql commands](https://postgres.ai/docs/dblab-howtos/joe-bot/get-database-table-index-size): Use Joe bot and psql meta-commands to get the size of Postgres databases, tables, indexes, views, and materialized views without direct database access. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/joe-bot/get-database-table-index-size.md) - [How to get a query execution plan (EXPLAIN)](https://postgres.ai/docs/dblab-howtos/joe-bot/get-query-plan): Get a Postgres EXPLAIN plan with actual execution using Joe bot, including buffer counts, row counts, and timing, on an independent thin clone. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/joe-bot/get-query-plan.md) - [How to get a list of active queries in a Joe session and stop long-running queries](https://postgres.ai/docs/dblab-howtos/joe-bot/query-activity-and-termination): Use Joe bot's activity command to list active Postgres queries in a session and the terminate command to stop long-running queries by PID. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/joe-bot/query-activity-and-termination.md) - [How to reset a Joe session](https://postgres.ai/docs/dblab-howtos/joe-bot/reset-session): Reset a Joe chatbot session to its initial state with the reset command, restoring the underlying DBLab clone and discarding all changes you made. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/joe-bot/reset-session.md) - [How to work with SQL optimization history](https://postgres.ai/docs/dblab-howtos/joe-bot/sql-optimization-history): Search, filter, share, and bookmark past Joe bot commands in the PostgresAI Platform SQL optimization history, including finding similar Postgres queries. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/joe-bot/sql-optimization-history.md) - [How to visualize a query plan](https://postgres.ai/docs/dblab-howtos/joe-bot/visualize-query-plan): Visualize a Postgres query plan with Joe bot using Explain Depesz, PEV2, or FlameGraph, from SQL optimization history or the Plan visualization page. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/joe-bot/visualize-query-plan.md) - [DBLab Platform](https://postgres.ai/docs/dblab-howtos/platform): Guides for the DBLab Platform: start using it, create and use access tokens, complete the onboarding checklist, and set up audit logs and SIEM. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/platform/index.md) - [Audit logs and SIEM integration](https://postgres.ai/docs/dblab-howtos/platform/audit-logs): View audit logs of critical events in the PostgresAI Platform and forward them to a SIEM such as Splunk or IBM QRadar for security monitoring and compliance. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/platform/audit-logs.md) - [DBLab Platform onboarding checklist](https://postgres.ai/docs/dblab-howtos/platform/onboarding): Onboarding checklist for the DBLab Platform: try Joe for SQL optimization, postgres-checkup reports, and DBLab Engine clones via the GUI, API, and CLI. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/platform/onboarding.md) - [Start using Database Lab (PostgresAI) Platform](https://postgres.ai/docs/dblab-howtos/platform/start-using-platform): Sign in to the PostgresAI Platform, create or join an organization, and choose how to begin: the Database Lab tutorial or the postgres-checkup tool. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/platform/start-using-platform.md) - [Create and use DBLab Platform access tokens](https://postgres.ai/docs/dblab-howtos/platform/tokens): Create, use, and revoke personal and administrative access tokens for DBLab Engine and the DBLab Platform, and enable personal token support. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/platform/tokens.md) - [How to work with snapshots](https://postgres.ai/docs/dblab-howtos/snapshots): How to work with DBLab Engine snapshots: create and delete snapshots using the GUI, the dblab CLI, or the API. [Markdown](https://postgres.ai/raw/docs/dblab-howtos/snapshots/index.md) - [How to create a snapshot](https://postgres.ai/docs/dblab-howtos/snapshots/create-snapshot): Create a DBLab Engine snapshot from an existing clone or from the current pool state using the GUI or the dblab CLI (dblab commit, dblab snapshot create). [Markdown](https://postgres.ai/raw/docs/dblab-howtos/snapshots/create-snapshot.md) - [How to delete a snapshot](https://postgres.ai/docs/dblab-howtos/snapshots/delete-snapshot): Delete a DBLab Engine snapshot using the GUI, the dblab CLI, or the API; force-delete snapshots with dependent clones; protect a snapshot from deletion or let the retention policy expire unused snapshots automatically (DBLab Engine 4.2+). [Markdown](https://postgres.ai/raw/docs/dblab-howtos/snapshots/delete-snapshot.md) ## Docs: tutorials - [Database Lab tutorials](https://postgres.ai/docs/tutorials): - Database Lab tutorial for any PostgreSQL database [Markdown](https://postgres.ai/raw/docs/tutorials/index.md) - [DBLab tutorial for any PostgreSQL database](https://postgres.ai/docs/tutorials/database-lab-tutorial): In this tutorial, we are going to set up a DBLab Engine in the Cloud. DBLab is used to boost software development and testing processes via enabling ultra-fast provisioning of databases of any size. [Markdown](https://postgres.ai/raw/docs/tutorials/database-lab-tutorial.md) - [Database Lab tutorial for Amazon RDS](https://postgres.ai/docs/tutorials/database-lab-tutorial-amazon-rds): In this tutorial, we are going to set up a DBLab Engine for an existing PostgreSQL DB instance on Amazon RDS. [Markdown](https://postgres.ai/raw/docs/tutorials/database-lab-tutorial-amazon-rds.md) - [Tutorial: Start using Joe Bot for PostgreSQL query optimization](https://postgres.ai/docs/tutorials/joe-setup): Learn how to use Joe bot to build a swift workflow of PostgreSQL query optimization running EXPLAIN commands on ultra-fast thin clones. [Markdown](https://postgres.ai/raw/docs/tutorials/joe-setup.md) ## Docs: data access - [Overview of data access use case](https://postgres.ai/docs/data-access): This page is unfinished. Reach out to the PostgresAI team to learn more. [Markdown](https://postgres.ai/raw/docs/data-access/index.md) ## Docs: data recovery - [Overview of data recovery use case](https://postgres.ai/docs/data-recovery): This page is unfinished. Reach out to the PostgresAI team to learn more. [Markdown](https://postgres.ai/raw/docs/data-recovery/index.md) ## Docs: Joe Bot - [Joe bot](https://postgres.ai/docs/joe-bot): Joe is a Postgres query optimization assistant. Joe allows you to boost the development process: [Markdown](https://postgres.ai/raw/docs/joe-bot/index.md) - [Joe bot demo and example](https://postgres.ai/docs/joe-bot/example): If you have the Slack app installed, try the live demonstration: [Markdown](https://postgres.ai/raw/docs/joe-bot/example.md) ## Docs: reference guides - [PostgresAI reference guides](https://postgres.ai/docs/reference-guides): Monitoring [Markdown](https://postgres.ai/raw/docs/reference-guides/index.md) - [DBLab API reference](https://postgres.ai/docs/reference-guides/database-lab-engine-api-reference): API reference for DBLab Engine – Swagger, OpenAPI [Markdown](https://postgres.ai/raw/docs/reference-guides/database-lab-engine-api-reference.md) - [DBLab Engine components](https://postgres.ai/docs/reference-guides/database-lab-engine-components): Operates as a Docker container. See the guide for administering DLE. For API and metrics details, see DBLab API reference and Prometheus monitoring. [Markdown](https://postgres.ai/raw/docs/reference-guides/database-lab-engine-components.md) - [DBLab Engine configuration reference](https://postgres.ai/docs/reference-guides/database-lab-engine-configuration-reference): DBLab Engine behavior can be controlled using the main configuration file that has YAML format. This reference describes available configuration options. [Markdown](https://postgres.ai/raw/docs/reference-guides/database-lab-engine-configuration-reference.md) - [DB Migration Checker configuration reference](https://postgres.ai/docs/reference-guides/db-migration-checker-configuration-reference): DB Migration Checker is a component of DBLab Engine (DLE). Its behavior is controlled using a separate configuration YAML file. [Markdown](https://postgres.ai/raw/docs/reference-guides/db-migration-checker-configuration-reference.md) - [Database Lab Client CLI reference (dblab)](https://postgres.ai/docs/reference-guides/dblab-client-cli-reference): The Database Lab Command Line Interface (dblab) is a tool that allows working with Database Lab instances in the console. [Markdown](https://postgres.ai/raw/docs/reference-guides/dblab-client-cli-reference.md) - [Joe Bot commands reference](https://postgres.ai/docs/reference-guides/joe-bot-commands-reference): Analyze your query (SELECT, INSERT, DELETE, UPDATE, or WITH) and generate recommendations. [Markdown](https://postgres.ai/raw/docs/reference-guides/joe-bot-commands-reference.md) - [Joe Bot configuration reference](https://postgres.ai/docs/reference-guides/joe-bot-configuration-reference): There are two ways to define Joe Bot options: [Markdown](https://postgres.ai/raw/docs/reference-guides/joe-bot-configuration-reference.md) - [PostgresAI Assistant (beta) tools](https://postgres.ai/docs/reference-guides/postgres-ai-bot-reference): This reference describes tools (functions) that are available to the PostgresAI Assistant Beta, including RAG KB semantic search, running benchmarks… [Markdown](https://postgres.ai/raw/docs/reference-guides/postgres-ai-bot-reference.md) - [postgres_ai monitoring reference documentation](https://postgres.ai/docs/reference-guides/postgres-ai-monitoring-reference): This page lists the user-facing metric groups. [Markdown](https://postgres.ai/raw/docs/reference-guides/postgres-ai-monitoring-reference.md) - [PostgresAI CLI reference](https://postgres.ai/docs/reference-guides/postgresai-cli-reference): PostgresAI Command Line Interface is a tool for working with PostgresAI: preparing databases for monitoring, running local monitoring stacks, generating… [Markdown](https://postgres.ai/raw/docs/reference-guides/postgresai-cli-reference.md) ## Postgres how-tos How-to guides for PostgreSQL database management, optimization, and best practices. - [Postgres how-to guides](https://postgres.ai/docs/postgres-howtos/): How-to guides for PostgreSQL database management, optimization, and best practices [Markdown](https://postgres.ai/raw/docs/postgres-howtos/index.md) - [Advanced topics](https://postgres.ai/docs/postgres-howtos/advanced-topics/): Deep dives into PostgreSQL internals, extensions, and advanced features. [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/index.md) - [Miscellaneous](https://postgres.ai/docs/postgres-howtos/advanced-topics/misc/): Various advanced PostgreSQL topics that don't fit into specific categories [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/misc/index.md) - [How to estimate the YoY growth of a very large table using row creation timestamps and the planner statistics](https://postgres.ai/docs/postgres-howtos/advanced-topics/misc/estimate-yoy-table-growth): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/misc/estimate-yoy-table-growth.md) - [How many tuples can be inserted in a page](https://postgres.ai/docs/postgres-howtos/advanced-topics/misc/how-many-tuples-can-be-inserted-in-a-page): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/misc/how-many-tuples-can-be-inserted-in-a-page.md) - [How to compile Postgres on Ubuntu 22.04](https://postgres.ai/docs/postgres-howtos/advanced-topics/misc/how-to-compile-postgres-on-ubuntu-22.04): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/misc/how-to-compile-postgres-on-ubuntu-22.04.md) - [How to find the best order of columns to save on storage ("Column Tetris")](https://postgres.ai/docs/postgres-howtos/advanced-topics/misc/how-to-find-the-best-order-of-columns-to-save-on-storage): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/misc/how-to-find-the-best-order-of-columns-to-save-on-storage.md) - [How to help others](https://postgres.ai/docs/postgres-howtos/advanced-topics/misc/how-to-help-others): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/misc/how-to-help-others.md) - [How to install Postgres 16 with plpython3u: Recipes for macOS, Ubuntu, Debian, CentOS, Docker](https://postgres.ai/docs/postgres-howtos/advanced-topics/misc/how-to-install-postgres-16-with-plpython3u): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/misc/how-to-install-postgres-16-with-plpython3u.md) - [How to use OpenAI APIs right from Postgres to implement semantic search and GPT chat](https://postgres.ai/docs/postgres-howtos/advanced-topics/misc/how-to-use-openai-apis-in-postgres): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/misc/how-to-use-openai-apis-in-postgres.md) - [How to work with metadata](https://postgres.ai/docs/postgres-howtos/advanced-topics/misc/how-to-work-with-metadata): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/misc/how-to-work-with-metadata.md) - [How to understand LSN values and WAL filenames](https://postgres.ai/docs/postgres-howtos/advanced-topics/misc/lsn-values-and-wal-filenames): LSN – Log Sequence Number, a pointer to a location in the Write-Ahead Log (WAL). [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/misc/lsn-values-and-wal-filenames.md) - [Understanding how sparsely tuples are stored in a table](https://postgres.ai/docs/postgres-howtos/advanced-topics/misc/tuple-sparsity): Today, we'll discuss tuples and their locations in pages – this is quite entry-level material but useful in many cases. [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/misc/tuple-sparsity.md) - [Replication](https://postgres.ai/docs/postgres-howtos/advanced-topics/replication/): Replication setup, monitoring, and troubleshooting [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/replication/index.md) - [How to convert a physical replica to logical](https://postgres.ai/docs/postgres-howtos/advanced-topics/replication/how-to-convert-a-physical-replica-to-logical): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/replication/how-to-convert-a-physical-replica-to-logical.md) - [How to troubleshoot streaming replication lag](https://postgres.ai/docs/postgres-howtos/advanced-topics/replication/how-to-troubleshoot-streaming-replication-lag): Learn how to troubleshoot streaming replication lag [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/replication/how-to-troubleshoot-streaming-replication-lag.md) - [Postgres major upgrade without any downtime for a very large cluster running under heavy load](https://postgres.ai/docs/postgres-howtos/advanced-topics/replication/zero-downtime-major-upgrade): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/advanced-topics/replication/zero-downtime-major-upgrade.md) - [Administration](https://postgres.ai/docs/postgres-howtos/database-administration/): Essential guides for PostgreSQL database administrators covering maintenance, backups, and configuration. [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/index.md) - [Backups, data export/import](https://postgres.ai/docs/postgres-howtos/database-administration/backup-recovery/): Backup strategies, recovery procedures, and data migration techniques [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/backup-recovery/index.md) - [How to speed up bulk load](https://postgres.ai/docs/postgres-howtos/database-administration/backup-recovery/how-to-speed-up-bulk-load): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/backup-recovery/how-to-speed-up-bulk-load.md) - [How to speed up pg_dump when dumping large databases](https://postgres.ai/docs/postgres-howtos/database-administration/backup-recovery/how-to-speed-up-pg-dump): After a series of rather hefty posts, let's take a breather with some lighter material. [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/backup-recovery/how-to-speed-up-pg-dump.md) - [How to use pg_restore](https://postgres.ai/docs/postgres-howtos/database-administration/backup-recovery/how-to-use-pg-restore): Today – a few tips on using `pg_restore` to restore databases (or only parts of them) from dumps. [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/backup-recovery/how-to-use-pg-restore.md) - [Configuration](https://postgres.ai/docs/postgres-howtos/database-administration/configuration/): PostgreSQL and system configuration for optimal performance [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/configuration/index.md) - [How to change a Postgres parameter](https://postgres.ai/docs/postgres-howtos/database-administration/configuration/how-to-change-postgres-parameter): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/configuration/how-to-change-postgres-parameter.md) - [How to perform initial / rough Postgres tuning](https://postgres.ai/docs/postgres-howtos/database-administration/configuration/how-to-perform-postgres-tuning): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/configuration/how-to-perform-postgres-tuning.md) - [How to tune Linux parameters for OLTP Postgres](https://postgres.ai/docs/postgres-howtos/database-administration/configuration/how-to-tune-linux-parameters-for-oltp-postgres): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/configuration/how-to-tune-linux-parameters-for-oltp-postgres.md) - [How to tune work_mem](https://postgres.ai/docs/postgres-howtos/database-administration/configuration/how-to-tune-work-mem): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/configuration/how-to-tune-work-mem.md) - [Rough configuration tuning (80/20 rule; OLTP)](https://postgres.ai/docs/postgres-howtos/database-administration/configuration/rough-oltp-configuration-tuning): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/configuration/rough-oltp-configuration-tuning.md) - [Maintenance](https://postgres.ai/docs/postgres-howtos/database-administration/maintenance/): Database maintenance tasks, vacuum strategies, and bloat management [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/maintenance/index.md) - [Autovacuum "queue" and progress](https://postgres.ai/docs/postgres-howtos/database-administration/maintenance/autovacuum-queue-and-progress): Monitor and manage autovacuum queue, understand worker activity and vacuum progress [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/maintenance/autovacuum-queue-and-progress.md) - [How to deal with bloat](https://postgres.ai/docs/postgres-howtos/database-administration/maintenance/how-to-deal-with-bloat): Detect, measure, and eliminate table and index bloat to maintain database health [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/maintenance/how-to-deal-with-bloat.md) - [How to deal with long-running transactions (OLTP)](https://postgres.ai/docs/postgres-howtos/database-administration/maintenance/how-to-deal-with-long-running-transactions-oltp): Identify and handle long-running transactions that can impact OLTP system performance [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/maintenance/how-to-deal-with-long-running-transactions-oltp.md) - [How to enable data checksums without downtime](https://postgres.ai/docs/postgres-howtos/database-administration/maintenance/how-to-enable-data-checksums-without-downtime): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/maintenance/how-to-enable-data-checksums-without-downtime.md) - [How to run ANALYZE (to collect statistics)](https://postgres.ai/docs/postgres-howtos/database-administration/maintenance/how-to-run-analyze): Learn how to how to run analyze (to collect statistics) [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/maintenance/how-to-run-analyze.md) - [How to troubleshoot a growing pg_wal directory](https://postgres.ai/docs/postgres-howtos/database-administration/maintenance/how-to-troubleshoot-a-growing-pg-wal-directory): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/maintenance/how-to-troubleshoot-a-growing-pg-wal-directory.md) - [How to troubleshoot and speed up Postgres stop and restart attempts](https://postgres.ai/docs/postgres-howtos/database-administration/maintenance/how-to-troubleshoot-and-speedup-postgres-restarts): #PostgresMarathon day 2. Let's discuss PostgreSQL shutdown and restarts. It's not uncommon to see quite long and even failed shutdown/restart attempts. [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/maintenance/how-to-troubleshoot-and-speedup-postgres-restarts.md) - [How to troubleshoot long Postgres startup](https://postgres.ai/docs/postgres-howtos/database-administration/maintenance/how-to-troubleshoot-long-startup): #PostgresMarathon day 3. In the previous how-to, we discussed how to quickly stop or restart PostgreSQL. [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/maintenance/how-to-troubleshoot-long-startup.md) - [How to use subtransactions in Postgres](https://postgres.ai/docs/postgres-howtos/database-administration/maintenance/how-to-use-subtransactions-in-postgres): Understand subtransactions, savepoints, and their impact on database performance [Markdown](https://postgres.ai/raw/docs/postgres-howtos/database-administration/maintenance/how-to-use-subtransactions-in-postgres.md) - [Development tools](https://postgres.ai/docs/postgres-howtos/development-tools/): Essential tools and techniques for PostgreSQL developers. [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/index.md) - [Client tools](https://postgres.ai/docs/postgres-howtos/development-tools/client-tools/): PostgreSQL client tools and utilities [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/client-tools/index.md) - [How to change ownership of all objects in a database](https://postgres.ai/docs/postgres-howtos/development-tools/client-tools/how-to-change-ownership-of-all-objects-in-a-database): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/client-tools/how-to-change-ownership-of-all-objects-in-a-database.md) - [How to set application_name without extra queries](https://postgres.ai/docs/postgres-howtos/development-tools/client-tools/how-to-set-application-name-without-extra-queries): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/client-tools/how-to-set-application-name-without-extra-queries.md) - [How to use Docker to run Postgres](https://postgres.ai/docs/postgres-howtos/development-tools/client-tools/how-to-use-docker-to-run-postgres): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/client-tools/how-to-use-docker-to-run-postgres.md) - [psql](https://postgres.ai/docs/postgres-howtos/development-tools/psql/): Master the PostgreSQL command-line interface [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/psql/index.md) - [How to format text output in psql scripts](https://postgres.ai/docs/postgres-howtos/development-tools/psql/how-to-format-text-output-in-psql-scripts): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/psql/how-to-format-text-output-in-psql-scripts.md) - [How to make "" work in psql on a new machine ("editor/nano/vi not found")](https://postgres.ai/docs/postgres-howtos/development-tools/psql/how-to-make-e-work-in-psql): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/psql/how-to-make-e-work-in-psql.md) - [How to plot graphs right in psql on macOS (iTerm2)](https://postgres.ai/docs/postgres-howtos/development-tools/psql/how-to-plot-graphs-right-in-psql-on-macos-iterm2): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/psql/how-to-plot-graphs-right-in-psql-on-macos-iterm2.md) - [How to use variables in psql scripts](https://postgres.ai/docs/postgres-howtos/development-tools/psql/how-to-use-variables-in-psql-scripts): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/psql/how-to-use-variables-in-psql-scripts.md) - [Learn how to work with schema metadata by spying after psql](https://postgres.ai/docs/postgres-howtos/development-tools/psql/learn-about-schema-metadata-via-psql): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/psql/learn-about-schema-metadata-via-psql.md) - [psql shortcuts](https://postgres.ai/docs/postgres-howtos/development-tools/psql/psql-shortcuts): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/psql/psql-shortcuts.md) - [psql tuning](https://postgres.ai/docs/postgres-howtos/development-tools/psql/psql-tuning): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/psql/psql-tuning.md) - [SQL techniques](https://postgres.ai/docs/postgres-howtos/development-tools/sql-techniques/): Advanced SQL patterns and query techniques [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/sql-techniques/index.md) - ["Find-or-insert" using a single query](https://postgres.ai/docs/postgres-howtos/development-tools/sql-techniques/find-or-insert-using-a-single-query): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/sql-techniques/find-or-insert-using-a-single-query.md) - [How to format SQL (SQL style guide)](https://postgres.ai/docs/postgres-howtos/development-tools/sql-techniques/how-to-format-sql): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/sql-techniques/how-to-format-sql.md) - [How to generate fake data](https://postgres.ai/docs/postgres-howtos/development-tools/sql-techniques/how-to-generate-fake-data): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/sql-techniques/how-to-generate-fake-data.md) - [How to import CSV to Postgres](https://postgres.ai/docs/postgres-howtos/development-tools/sql-techniques/how-to-import-csv-to-postgres): ## Source CSV we'll be using as an example [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/sql-techniques/how-to-import-csv-to-postgres.md) - [How to use lib_pgquery in shell to normalize and match queries from various sources](https://postgres.ai/docs/postgres-howtos/development-tools/sql-techniques/how-to-use-lib-pgquery-in-shell): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/development-tools/sql-techniques/how-to-use-lib-pgquery-in-shell.md) - [Miscellaneous Postgres guides](https://postgres.ai/docs/postgres-howtos/miscellaneous/): Various PostgreSQL tips, antipatterns, and general advice that don't fit into specific categories [Markdown](https://postgres.ai/raw/docs/postgres-howtos/miscellaneous/index.md) - [How to get into trouble using some Postgres features](https://postgres.ai/docs/postgres-howtos/miscellaneous/how-to-get-into-trouble-using-some-postgres-features): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/miscellaneous/how-to-get-into-trouble-using-some-postgres-features.md) - [Monitoring & troubleshooting](https://postgres.ai/docs/postgres-howtos/monitoring-troubleshooting/): Tools and techniques for monitoring PostgreSQL and solving common problems. [Markdown](https://postgres.ai/raw/docs/postgres-howtos/monitoring-troubleshooting/index.md) - [Lock analysis](https://postgres.ai/docs/postgres-howtos/monitoring-troubleshooting/lock-analysis/): Analyze and resolve locking issues and deadlocks [Markdown](https://postgres.ai/raw/docs/postgres-howtos/monitoring-troubleshooting/lock-analysis/index.md) - [How to understand what's blocking DDL](https://postgres.ai/docs/postgres-howtos/monitoring-troubleshooting/lock-analysis/how-to-understand-what-is-blocking-ddl): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/monitoring-troubleshooting/lock-analysis/how-to-understand-what-is-blocking-ddl.md) - [System monitoring](https://postgres.ai/docs/postgres-howtos/monitoring-troubleshooting/system-monitoring/): Monitor replication, WAL generation, and system health [Markdown](https://postgres.ai/raw/docs/postgres-howtos/monitoring-troubleshooting/system-monitoring/index.md) - [How to troubleshoot Postgres performance using FlameGraphs and eBPF (or perf)](https://postgres.ai/docs/postgres-howtos/monitoring-troubleshooting/system-monitoring/flamegraphs-for-postgres): Today we'll discuss how to understand what exactly a Postgres backend is doing inside CPU on a Linux machine (in-CPU analysis). [Markdown](https://postgres.ai/raw/docs/postgres-howtos/monitoring-troubleshooting/system-monitoring/flamegraphs-for-postgres.md) - [How to determine the replication lag](https://postgres.ai/docs/postgres-howtos/monitoring-troubleshooting/system-monitoring/how-to-determine-the-replication-lag): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/monitoring-troubleshooting/system-monitoring/how-to-determine-the-replication-lag.md) - [Troubleshooting](https://postgres.ai/docs/postgres-howtos/monitoring-troubleshooting/troubleshooting/): Troubleshoot common issues and performance problems [Markdown](https://postgres.ai/raw/docs/postgres-howtos/monitoring-troubleshooting/troubleshooting/index.md) - [How to flush caches (OS page cache and Postgres buffer pool)](https://postgres.ai/docs/postgres-howtos/monitoring-troubleshooting/troubleshooting/how-to-flush-caches): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/monitoring-troubleshooting/troubleshooting/how-to-flush-caches.md) - [How to NOT get screwed as a DBA (DBRE)](https://postgres.ai/docs/postgres-howtos/monitoring-troubleshooting/troubleshooting/how-to-not-get-screwed-as-a-dba): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/monitoring-troubleshooting/troubleshooting/how-to-not-get-screwed-as-a-dba.md) - [Performance & optimization](https://postgres.ai/docs/postgres-howtos/performance-optimization/): Master PostgreSQL performance optimization with practical guides covering query tuning, indexing strategies, and system optimization. [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/index.md) - [Benchmarks](https://postgres.ai/docs/postgres-howtos/performance-optimization/benchmarks/): Techniques and tools for benchmarking PostgreSQL performance [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/benchmarks/index.md) - [How to benchmark](https://postgres.ai/docs/postgres-howtos/performance-optimization/benchmarks/how-to-benchmark): Benchmarking is a huge topic. Here, we cover minimal steps that are required for a Postgres benchmark to be informative, useful, and correct. [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/benchmarks/how-to-benchmark.md) - [Pre- and post-steps for benchmark iterations](https://postgres.ai/docs/postgres-howtos/performance-optimization/benchmarks/pre-and-post-steps-for-benchmark-iterations): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/benchmarks/pre-and-post-steps-for-benchmark-iterations.md) - [Indexing](https://postgres.ai/docs/postgres-howtos/performance-optimization/indexing/): Index creation, maintenance, monitoring, and optimization strategies [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/indexing/index.md) - [How to find redundant indexes](https://postgres.ai/docs/postgres-howtos/performance-optimization/indexing/how-to-find-redundent-indexes): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/indexing/how-to-find-redundent-indexes.md) - [How to find unused indexes](https://postgres.ai/docs/postgres-howtos/performance-optimization/indexing/how-to-find-unused-indexes): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/indexing/how-to-find-unused-indexes.md) - [How to monitor CREATE INDEX / REINDEX progress in Postgres 12+](https://postgres.ai/docs/postgres-howtos/performance-optimization/indexing/how-to-monitor-index-operations): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/indexing/how-to-monitor-index-operations.md) - [Index maintenance](https://postgres.ai/docs/postgres-howtos/performance-optimization/indexing/index-maintenance): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/indexing/index-maintenance.md) - [Over-indexing](https://postgres.ai/docs/postgres-howtos/performance-optimization/indexing/over-indexing): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/indexing/over-indexing.md) - [How to rebuild many indexes using many backends avoiding deadlocks](https://postgres.ai/docs/postgres-howtos/performance-optimization/indexing/rebuild-indexes-without-deadlocks): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/indexing/rebuild-indexes-without-deadlocks.md) - [Monitoring](https://postgres.ai/docs/postgres-howtos/performance-optimization/monitoring/): Monitor database performance, analyze statistics, and track system metrics [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/monitoring/index.md) - [Ad-hoc monitoring](https://postgres.ai/docs/postgres-howtos/performance-optimization/monitoring/ad-hoc-monitoring): In some cases, we need to observe some values in Postgres or the environment it's running on (OS, FS, etc.), and: [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/monitoring/ad-hoc-monitoring.md) - [How to analyze heavyweight locks, part 1](https://postgres.ai/docs/postgres-howtos/performance-optimization/monitoring/how-to-analyze-heavyweight-locks-part-1): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/monitoring/how-to-analyze-heavyweight-locks-part-1.md) - [How to monitor transaction ID wraparound risks](https://postgres.ai/docs/postgres-howtos/performance-optimization/monitoring/how-to-monitor-transaction-id-wraparound-risks): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/monitoring/how-to-monitor-transaction-id-wraparound-risks.md) - [How to monitor xmin horizon to prevent XID/MultiXID wraparound and high bloat](https://postgres.ai/docs/postgres-howtos/performance-optimization/monitoring/how-to-monitor-xmin-horizon): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/monitoring/how-to-monitor-xmin-horizon.md) - [How to reduce WAL generation rates](https://postgres.ai/docs/postgres-howtos/performance-optimization/monitoring/how-to-reduce-wal-generation-rates): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/monitoring/how-to-reduce-wal-generation-rates.md) - [How to work with pg_stat_statements, part 1](https://postgres.ai/docs/postgres-howtos/performance-optimization/monitoring/pg-stat-statements-part-1): There are two big branches of query optimization: [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/monitoring/pg-stat-statements-part-1.md) - [Query tuning](https://postgres.ai/docs/postgres-howtos/performance-optimization/query-tuning/): Optimize query performance with EXPLAIN ANALYZE, execution plans, and performance tuning techniques [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/query-tuning/index.md) - [EXPLAIN ANALYZE or EXPLAIN (ANALYZE, BUFFERS)?](https://postgres.ai/docs/postgres-howtos/performance-optimization/query-tuning/explain-analyze-buffers): UPDATE 2025: Starting with Postgres 18, the `BUFFERS` option becomes default in `EXPLAIN ANALYZE`, which is great news. [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/query-tuning/explain-analyze-buffers.md) - [How to find query examples for problematic pg_stat_statements records](https://postgres.ai/docs/postgres-howtos/performance-optimization/query-tuning/from-pgss-to-explain--how-to-find-query-examples): In a few hours, I'm presenting my "Seamless Postgres query optimization" tutorial at DjangoCon US, so it's a good time to talk about transitioning from… [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/query-tuning/from-pgss-to-explain--how-to-find-query-examples.md) - [How to decide when a query is too slow and needs optimization](https://postgres.ai/docs/postgres-howtos/performance-optimization/query-tuning/how-to-decide-if-query-too-slow): "Slow" is a relative concept. In some cases, we might be happy with query latency 1 minute (or no?), while in other scenarios, even 1 ms might seem to be too… [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/query-tuning/how-to-decide-if-query-too-slow.md) - [How to make the non-production Postgres planner behave like in production](https://postgres.ai/docs/postgres-howtos/performance-optimization/query-tuning/how-to-imitate-production-planner): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/performance-optimization/query-tuning/how-to-imitate-production-planner.md) - [Schema design](https://postgres.ai/docs/postgres-howtos/schema-design/): Best practices for designing efficient PostgreSQL schemas and managing database objects. [Markdown](https://postgres.ai/raw/docs/postgres-howtos/schema-design/index.md) - [Constraints](https://postgres.ai/docs/postgres-howtos/schema-design/constraints/): Foreign keys, check constraints, and data integrity [Markdown](https://postgres.ai/raw/docs/postgres-howtos/schema-design/constraints/index.md) - [How to add a foreign key](https://postgres.ai/docs/postgres-howtos/schema-design/constraints/how-to-add-a-foreign-key): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/schema-design/constraints/how-to-add-a-foreign-key.md) - [How to find int4 PKs with out-of-range risks in a large database](https://postgres.ai/docs/postgres-howtos/schema-design/constraints/how-to-find-int4-pks-with-out-of-range-risks): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/schema-design/constraints/how-to-find-int4-pks-with-out-of-range-risks.md) - [How to remove a foreign key](https://postgres.ai/docs/postgres-howtos/schema-design/constraints/how-to-remove-a-foreign-key): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/schema-design/constraints/how-to-remove-a-foreign-key.md) - [Data types](https://postgres.ai/docs/postgres-howtos/schema-design/data-types/): Choose and optimize data types for your use case [Markdown](https://postgres.ai/raw/docs/postgres-howtos/schema-design/data-types/index.md) - [How to quickly check data type and storage size of a value](https://postgres.ai/docs/postgres-howtos/schema-design/data-types/how-to-quickly-check-data-type-and-storage-size-of-a-value): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/schema-design/data-types/how-to-quickly-check-data-type-and-storage-size-of-a-value.md) - [How to use UUID](https://postgres.ai/docs/postgres-howtos/schema-design/data-types/how-to-use-uuid): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/schema-design/data-types/how-to-use-uuid.md) - [UUID v7 and partitioning (TimescaleDB)](https://postgres.ai/docs/postgres-howtos/schema-design/data-types/uuid-v7-and-partitioning-timescaledb): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/schema-design/data-types/uuid-v7-and-partitioning-timescaledb.md) - [DDL operations](https://postgres.ai/docs/postgres-howtos/schema-design/ddl-operations/): Safe schema changes, column management, and zero-downtime migrations [Markdown](https://postgres.ai/raw/docs/postgres-howtos/schema-design/ddl-operations/index.md) - [How to add a CHECK constraint without downtime](https://postgres.ai/docs/postgres-howtos/schema-design/ddl-operations/how-to-add-a-check-constraint-without-downtime): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/schema-design/ddl-operations/how-to-add-a-check-constraint-without-downtime.md) - [How to add a column](https://postgres.ai/docs/postgres-howtos/schema-design/ddl-operations/how-to-add-a-column): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/schema-design/ddl-operations/how-to-add-a-column.md) - [How to drop a column](https://postgres.ai/docs/postgres-howtos/schema-design/ddl-operations/how-to-drop-a-column): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/schema-design/ddl-operations/how-to-drop-a-column.md) - [How to redefine a PK without downtime](https://postgres.ai/docs/postgres-howtos/schema-design/ddl-operations/how-to-redefine-a-PK-without-downtime): [Markdown](https://postgres.ai/raw/docs/postgres-howtos/schema-design/ddl-operations/how-to-redefine-a-PK-without-downtime.md) ## Blog - [PostgresAI blog](https://postgres.ai/blog): All posts, newest first. - [PGAIBench and AAA: can AI safely change production Postgres?](https://postgres.ai/blog/20261123-pgaibench): Frontier AI models acting alone broke live Postgres 18 clusters 13 times. Separating duties with AAA blocked 12 of 13 harms (99.7% safe approved). - [The hidden costs of CREATE TEMP TABLE: catalog bloat and LWLock:SInvalWrite](https://postgres.ai/blog/20261118-hidden-costs-of-create-temp-table): Postgres 18: a CTE ran 23x the TPS of a temp table per transaction. With 5000 idle sessions, temp-table DDL got 127 and 249 of a 500 TPS target in two runs. - [UUIDv4 vs UUIDv7: what a random primary key costs in Postgres](https://postgres.ai/blog/20261105-uuidv4-vs-uuidv7): Same table, same insert stream, three primary keys on Postgres 18. At 100M rows, UUIDv4 inserted at 0.62 to 0.69 of the rate of an ordered key on the same server, and wrote 1.5 to 1.9 times the WAL per row. - [What your Postgres is waiting for, and why the dashboard can't tell you](https://postgres.ai/blog/20261103-what-postgres-is-waiting-for): Wait events, explained for everyone: what the live flag means, how every dashboard samples it, and one measured incident where the dashboard's own fixes did nothing and the cause was a lock it ranked fifth, at 2%. - [Dump/restore done. Now what?](https://postgres.ai/blog/20261028-dump-restore-now-what): After pg_dump and pg_restore, by default the planner statistics and the visibility map are missing. One query: 32.6 s before VACUUM ANALYZE, 23 ms after. - [DBLab 4.2: clone upgrades, simplified install, retention, and more](https://postgres.ai/blog/20260917-dblab-engine-4-2-released): DBLab 4.0 made database branching instant. 4.1 added the controls around it — protection leases, Teleport, metrics. - [DBLab 4.1: protection leases, Teleport, Prometheus, and more](https://postgres.ai/blog/20260408-dblab-engine-4-1-released): DBLab 4.0 introduced instant database branching with O(1) economics. - [PG18 preserves planner statistics on upgrade — even from PG14](https://postgres.ai/blog/20260324-pg18-stats-upgrade-across-versions): Postgres 18 can preserve planner statistics during major version upgrades. But can it work when upgrading from an older version to PG18 — which many plan to do soon? Let's test and see. - [How moving one word can speed up a query 10–50x](https://postgres.ai/blog/20260311-not-exists-vs-exists-partial-index): One of these queries is 32x faster than the other. Which one, and why? - [The hidden cost of invalid indexes in Postgres (yes, even on Supabase/RDS/Neon)](https://postgres.ai/blog/20260106-invalid-index-overhead): When CREATE INDEX CONCURRENTLY or REINDEX INDEX CONCURRENTLY fails, Postgres leaves behind an invalid index. Many engineers assume these indexes are harmless placeholders waiting to be cleaned up. ## Optional - [Vision & roadmap](https://postgres.ai/docs/roadmap): PostgresAI's vision for Self-Driving Postgres and the roadmap to get there [Markdown](https://postgres.ai/raw/docs/roadmap.md) - [Case studies](https://postgres.ai/resources/): Customer case studies. - [pgTrue llms.txt](https://pgtrue.postgres.ai/llms.txt): Index of pgTrue fact-check reports. - [Postgres FM](https://postgres.fm): A weekly podcast about all things PostgreSQL. - [Postgres.TV](https://www.youtube.com/PostgresTV): YouTube channel. - [Terms of service](https://postgres.ai/tos/): Terms of service. - [Privacy policy](https://postgres.ai/privacy/): Privacy policy. - [#PostgresMarathon 2-013: Why keep your index set lean](https://postgres.ai/blog/20251110-postgres-marathon-2-013-why-keep-your-index-set-lean): Your API is slowing down. You check your database and find 42 indexes on your users table. Which ones can you safely drop? How much performance are they costing you? - [#PostgresMarathon 2-012: Ultra-fast replica creation with pgBackRest](https://postgres.ai/blog/20251105-postgres-marathon-2-012-ultra-fast-replica-creation-pgbackrest): Suppose you need to create a replica for a 1 TiB database. - [#PostgresMarathon 2-011: Prepared statements and partitioned tables — the paradox, part 3](https://postgres.ai/blog/20251030-postgres-marathon-2-011): In #PostgresMarathon 2-009 and #PostgresMarathon 2-010, we explored why execution 6 causes a lock explosion when building a generic plan for partitioned tables — the planner must lock all 52 relations because it can't prune without… - [#PostgresMarathon 2-010: Prepared statements and partitioned table lock explosion, part 2](https://postgres.ai/blog/20251029-postgres-marathon-2-010): In #PostgresMarathon 2-009, we focused on Lock Manager's behavior when dealing with prepared statements and partitioned tables. - [#PostgresMarathon 2-009: Prepared statements and partitioned table lock explosion, part 1](https://postgres.ai/blog/20251028-postgres-marathon-2-009): In #PostgresMarathon 2-008, we discovered that prepared statements can dramatically reduce LWLock:LockManager contention by switching from planner locks (which lock everything) to executor locks (which lock only what's actually used). - [#PostgresMarathon 2-008: LWLock:LockManager and prepared statements](https://postgres.ai/blog/20251014-postgres-marathon-2-008): As was discussed in #PostgresMarathon 2-002, for a simple SELECT from a table, at planning time, Postgres locks the table and all of its indexes with AccessShareLock. - [#PostgresMarathon 2-007: Should we worry about pg_blocking_pids()'s observer effect?](https://postgres.ai/blog/20251013-postgres-marathon-2-007): Many years ago, when developing complex automated procedures for a large company, I realized that my automation needs monitoring components. - [#PostgresMarathon 2-006: Mysterious max_locks_per_transaction](https://postgres.ai/blog/20251010-postgres-marathon-2-006): The setting maxlockspertransaction is mysterious, it is a good illustration of Socrates' "I know that I know nothing". This is the main fact to memorize about maxlockspertransaction. Don't try to remember details. - [#PostgresMarathon 2-005: More LWLock:LockManager benchmarks for Postgres 18](https://postgres.ai/blog/20251009-postgres-marathon-2-005): In 2023-2024, after incidents that multiple customers of PostgresAI experienced, when production nodes were down because of LWLock:LockManager contention, we studied it in synthetic environments. - [#PostgresMarathon 2-004: Fast-path locking explained](https://postgres.ai/blog/20251008-postgres-marathon-2-004): After 2-003, @ninjouz asked on X: - [#PostgresMarathon 2-003: The roots of LWLock:LockManager](https://postgres.ai/blog/20251007-postgres-marathon-2-003): As we discussed, Lock Manager manages heavyweight locks – various kinds of them (various modes, various levels of granularity). These locks are released only at the end of the transaction. - [#PostgresMarathon 2-002: Relation-level locks](https://postgres.ai/blog/20251005-postgres-marathon-2-002): Let's talk about relation-level locks and various confusions, surprises and what is worth to remember in practice. - [#PostgresMarathon 2-001: Lightweight and heavyweight locks](https://postgres.ai/blog/20251005-postgres-marathon-2-001): To warm up, let's talk about lightweight and heavyweight locks (or "regular locks" or just "locks"). - [Self-driving Postgres](https://postgres.ai/blog/20250725-self-driving-postgres): Building the first truly self-driving PostgreSQL: zero downtime upgrades, AI-powered automation, and a roadmap to full database autonomy. - [Full-stack preview environments with DBLab 4.0: isolated databases for every pull request](https://postgres.ai/blog/20250724-full-stack-preview-environments-with-dblab): Learn how DBLab 4.0 database branching enables instant, cost-effective preview environments with isolated Postgres clones for every pull request. Includes practical implementation examples with CI/CD integration. - [Introducing Postgres how-tos: practical guides for real-world database challenges](https://postgres.ai/blog/20250724-postgres-howtos-launch): Today, as part of our Launch Week (Day 4), we're excited to announce the release of our Postgres how-to guides collection – a comprehensive set of dozens of practical guides covering real-world PostgreSQL challenges. - [Postgres AI Checkup service: expert-led, AI-assisted comprehensive database health assessment](https://postgres.ai/blog/20250723-postgres-ai-checkup-service): Monthly expert-led Postgres database health assessments with AI assistance. Get comprehensive reports, expert calls, and proactive monitoring to prevent performance issues and scale confidently. - [SQL query toolkit in Postgres AI Console – analyze, visualize and share query plans with popular tools](https://postgres.ai/blog/20250722-query-analysis-toolkit): A toolkit for PostgreSQL professionals to input and analyze custom queries and execution plans using visualization tools, AI insights, and easy sharing capabilities. - [postgres_ai monitoring – expert-level Postgres monitoring tool for humans and AI](https://postgres.ai/blog/20250722-postgres-ai-v0-7-expert-level-postgresql-monitoring): A monitoring solution built specifically for PostgreSQL experts who need rapid root cause analysis and deep performance insights. Combines real-time monitoring with deep analysis capabilities for human experts and AI systems. - [DBLab 4.0: instant database branching with O(1) economics](https://postgres.ai/blog/20250721-dblab-engine-4-0-released): The cost of experimentation determines the pace of innovation. In database development, this cost has traditionally been measured in hours and thousands of dollars per environment. - [AI-assisted Postgres experiment: number of partitions vs. planning time](https://postgres.ai/blog/20241003-how-does-planning-time-depend-on-number-of-partitions):