---
title: "PostgreSQL 19: online repacking and new query plan dials | Daniel Segovia"
description: "PostgreSQL 19 brings online REPACK and planner controls. Less downtime, more predictable plans. My take: run compatibility and load tests before upgrading."
url: https://danielsegovia.com/en/architecture/postgresql-19-online-repack-planner-controls/
lang: en
author: "Daniel Segovia"
published: 2026-11-22T19:52:00.000Z
modified: 2026-11-23T04:47:16.361Z
section: "Architecture"
---

1.  [Home](https://danielsegovia.com/en/)
2.  [Architecture](https://danielsegovia.com/en/architecture/)
3.  PostgreSQL 19: online repacking and new query plan dials

# PostgreSQL 19: online repacking and new query plan dials

[Architecture](https://danielsegovia.com/en/architecture/) By [Daniel Segovia](https://danielsegovia.com/en/about/) · November 22, 2026 ·Updated on November 23, 2026 · 3 min read

PostgreSQL 19 brings online REPACK and planner controls. Less downtime, more predictable plans. My take: run compatibility and load tests before upgrading.

In this post

1.  [What happened](#what-happened)
2.  [Why it matters](#why-it-matters)
3.  [Impact on your architecture](#impact-on-your-architecture)
4.  [What I’d do](#what-i-d-do)

PostgreSQL 19 lands with *REPACK* and new query planning controls. The pitch: lower maintenance disruption and more levers to shape plans without touching app code. If you run serious OLTP/OLAP, this might save a few weekends.

## What happened

The headliner is **REPACK**, which reclaims table space and can reorder data to match an index. With `CONCURRENTLY` it doesn’t block reads or writes, a drop-in for many `VACUUM FULL` and `CLUSTER` jobs.

New extensions **pg\_plan\_advice** and **pg\_stash\_advice** let you influence plan selection and apply stored advice by query identifier, no app changes needed. Also: *parallel index vacuuming*, tweaks to *autovacuum* prioritization, and extra monitoring views.

`EXPLAIN ANALYZE` and logging now report async I/O and WAL generated for full-page images. Planner got better anti-joins for eligible `NOT IN` and eager aggregation before joins. Tests showed bulk inserts nearly 2x faster after foreign key check changes.

Replication and dev: **logical replication** supports sequence values, and the server auto-raises effective WAL level to `logical` when the first logical slot is created. **WAIT FOR LSN** lets apps wait until a standby replays a WAL position, enabling read-your-writes. For developers: `INSERT ... ON CONFLICT DO SELECT` for get-or-create, **JSON output from COPY**, more **SQL/JSON** string methods, and **IGNORE NULLS** for window functions.

Security and compatibility: server-side **TLS SNI** (different certs per hostname), a warning after successful MD5 auth (MD5 was deprecated in 18 and is slated for removal; SCRAM recommended). **JIT disabled by default** due to unreliable cost estimates. **LZ4** becomes the default TOAST compression when supported by the build.

## Why it matters

**Less downtime**: REPACK `CONCURRENTLY` shrinks or removes maintenance windows to reclaim space and reorder data. On big tables, that’s gold.

**Planner control without code changes**: handy when OLTP and OLAP coexist and the “best” plan depends on real workload. You get fine-grained dials without patching the app.

**Replica read consistency**: WAIT FOR LSN provides clean read-your-writes on standbys. Fewer “sleep N ms” hacks.

**Defaults with bite**: JIT off may shift CPU/latency profiles; LZ4 in TOAST changes storage/CPU trade-offs; MD5 warnings nudge you to SCRAM.

## Impact on your architecture

-   *High-churn OLTP*: concurrent REPACK to fight bloat without traffic freezes.
-   *Mixed OLAP*: planner advice can tame unruly queries.
-   *Replica reads*: WAIT FOR LSN enables cleaner read-your-writes patterns.
-   *Security*: SNI helps when certs vary by hostname.

## What I’d do

-   **Don’t jump critical prod to 19.0 blind**. The community’s classic advice still applies: for critical systems, wait for the .1 release. If 19 solves a pain, run a parallel pilot.
-   **Compatibility plan**: staging with your extensions and used features. Review auth (move to **SCRAM**), JIT default off, and TOAST’s **LZ4**.
-   **Load tests**: real OLTP/OLAP workloads. Compare plans with/without `pg_plan_advice`. Watch async I/O and WAL in `EXPLAIN ANALYZE`.
-   **Maintenance**: replace `VACUUM FULL`/`CLUSTER` with `REPACK CONCURRENTLY` where it fits. Revisit *autovacuum* strategy given its new prioritization.
-   **Replication**: validate sequences with logical replication, and use **WAIT FOR LSN** where read consistency matters.
-   **Dev**: leverage `INSERT ... ON CONFLICT DO SELECT` for upserts-with-reads; try **COPY to JSON** in pipelines.

My read: 19 brings real operational relief and useful planner dials, but upgrading a critical DB without rehearsal is asking Murphy to deploy. Pilot, measure, then decide. Has your team tried hot REPACK on large tables yet?

PS: if your DBA smiles on a Monday, they probably ran REPACK CONCURRENTLY on Sunday.

## Tags

-   [#PostgreSQL](https://danielsegovia.com/en/tags/postgresql/)
-   [#Databases](https://danielsegovia.com/en/tags/databases/)
-   [#Performance](https://danielsegovia.com/en/tags/performance/)
-   [#Replication](https://danielsegovia.com/en/tags/replication/)

[See all tags →](https://danielsegovia.com/en/tags/)

## Related posts

-   [Cloudflare toggle for AI-agent search, and you pay the bill](https://danielsegovia.com/en/architecture/cloudflare-toggle-ai-agent-search-cost-privacy/)
    
    Cloudflare added a toggle for AI agents to search your site. You pay the query bill. Good DX, new risks to budgets and privacy. Add access controls and limits.
    
    3 min read
-   [DoorDash splits coordination and compute: 10x and 99.99%](https://danielsegovia.com/en/architecture/doordash-splits-coordination-compute-10x-9999/)
    
    DoorDash rebuilt dispatch by splitting coordination from compute. 10x throughput and 99.99% at peak. What can we copy without blowing our SLAs?
    
    3 min read
-   [AWS Lambda: orchestrating MicroVMs with Durable Functions](https://danielsegovia.com/en/architecture/aws-lambda-durable-functions-microvms-orchestration/)
    
    AWS previews MicroVM orchestration in Lambda durable functions. Run untrusted or agent code in VM-isolated sandboxes within year-long serverless flows.
    
    3 min read

## More categories

-   ### [Tutorials](https://danielsegovia.com/en/tutorials/)
    
    [How to create a TypeScript Lambda with AWS SAM](https://danielsegovia.com/en/tutorials/create-typescript-lambda-aws-sam/)
    
    How to create a TypeScript Lambda with AWS SAM. Initialize the project, compile with esbuild, test locally, and deploy to AWS in minutes without pain.
    
    New 5 min read
    
-   ### [News](https://danielsegovia.com/en/news/)
    
    [Huawei speeds chip design; Nvidia slows ASEAN server flows](https://danielsegovia.com/en/news/huawei-speeds-chip-design-nvidia-slows-asean-servers/)
    
    Huawei pushes its homegrown chip-design stack while Nvidia halts AI server shipments in ASEAN. If you bet on one vendor, map risk and ship a plan B.
    
    New 3 min read
    
-   ### [Artificial Intelligence](https://danielsegovia.com/en/artificial-intelligence/)
    
    [OpenAI/Anthropic lock data; China turns to Google and Meta](https://danielsegovia.com/en/artificial-intelligence/openai-anthropic-lock-data-china-google-meta/)
    
    OpenAI and Anthropic restricted data and Chinese players look to Google and Meta. Time to harden pipelines: clear licenses and a data plan B.
    
    New 3 min read
    
-   ### [Security](https://danielsegovia.com/en/security/)
    
    [GoodGuys phishing mimics brands to steal Google/Okta](https://danielsegovia.com/en/security/goodguys-phishing-google-okta-paid-interviews/)
    
    GoodGuys lures with paid interviews to steal corporate Google/Okta creds. Active since October. Priorities: FIDO MFA, phishing drills, and tight SSO control.
    
    New 3 min read
    
-   ### [Architecture](https://danielsegovia.com/en/architecture/)
    
    [Cloudflare toggle for AI-agent search, and you pay the bill](https://danielsegovia.com/en/architecture/cloudflare-toggle-ai-agent-search-cost-privacy/)
    
    Cloudflare added a toggle for AI agents to search your site. You pay the query bill. Good DX, new risks to budgets and privacy. Add access controls and limits.
    
    New 3 min read
    
-   ### [Business](https://danielsegovia.com/en/business/)
    
    [AI infrastructure spend could hit $1T in 2026: now what](https://danielsegovia.com/en/business/ai-infrastructure-spend-2026-1t/)
    
    AI infra investment could reach $1T in 2026. With a $1.8T funding gap through 2030, it’s time to lock budgets, renegotiate contracts and squeeze unit costs.
    
    New 3 min read

---

Sitio: https://danielsegovia.com/ · Índice para agentes: https://danielsegovia.com/llms.txt · Sitemap: https://danielsegovia.com/sitemap.xml
