Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 12 min read Deep dive mediumAdept

New system views in PostgreSQL 19

PostgreSQL 19 (in beta) adds four system views, and three of them get hands-on demos. pg_stat_lock gives cumulative per-locktype wait counts, wait time and fastpath_exceeded counters, though waits only count once they pass deadlock_timeout. pg_stat_recovery returns standby replay state as one atomic, consistent snapshot. pg_stat_autovacuum_scores shows the new score-based autovacuum prioritization, tunable through five weight parameters. Worked SQL examples cover lock contention, fast-path spill on a 140-partition table (alongside the new max_locks_per_transaction default of 128) and how autovacuum scores are computed from thresholds.

Related posts

  • What's New with Monitoring in PostgreSQL 19

    ClickHouse mediumAdept

    PostgreSQL 19 (in beta) brings a batch of monitoring improvements. log_lock_waits is now on by default, log_min_messages accepts per-process-type levels, and autoanalyze gets its own log_autoanalyze_min_duration threshold. A new wal_fpi_bytes counter is exposed in pg_stat_wal, per backend, in EXPLAIN and in VACUUM/ANALYZE logs. Other additions are new wait events for WAL LSN waits and file/pipe COPY I/O, remote-server messages routed through normal log formatting, a pg_get_multixact_stats() function, and an earlier 100M-transaction wraparound warning. The post closes with an upgrade checklist for log parsers, metric collectors, wait-event dictionaries, config UIs and age(datfrozenxid) alert thresholds.

  • PostgreSQL 19 on ClickHouse Managed Postgres, from day one

    ClickHouse mediumAdept

    PostgreSQL 19 has been generally available on ClickHouse Managed Postgres since its November 2026 release day. That was possible because the service runs unforked community Postgres from the PGDG repository, builds VM images from release candidates with Ubicloud, gates the version behind a feature flag, and stress-tests HA failovers in staging. The post then covers the PostgreSQL 19 features that matter most for operators: REPACK CONCURRENTLY and its caveats (not MVCC-safe, a final ACCESS EXCLUSIVE lock, disk space needs), WAIT FOR LSN for read-your-writes on replicas, sequence replication and publication EXCEPT, parallel autovacuum index workers with scoring, and pg_plan_advice. A pgbench run with one synchronous standby showed about 2% higher TPS than PostgreSQL 18, and several defaults changed, including jit off, lz4 TOAST compression and max_locks_per_transaction at 128.

  • Postgres 19 is out: try it on Neon

    Neon mediumAdept

    Postgres 19 is an operations-focused release that adds REPACK (CONCURRENTLY) for online table rebuilding and clustering via logical decoding, pg_plan_advice/pg_stash_advice for stabilizing bad plans by query ID, parallel autovacuum with priority scoring, WAIT FOR LSN for read-your-writes on replicas, and logical replication sequence sync. REPACK CONCURRENTLY needs a replication slot, temporary disk for a full copy, and fails if more than ~104M tuples change during the run, and it is not MVCC-safe for older snapshots. Other additions include postgres_fdw statistics import, ON CONFLICT DO SELECT, JSON output for COPY TO, and new stats views. SQL/PGQ, FOR PORTION OF, partition merge/split and GROUP BY ALL were reverted before GA.

  • Postgres Support Recap: Investigating Postgres Query Performance

    Neon mediumAdept

    Three starting points for diagnosing slow Postgres queries: use pg_stat_statements to find long-running queries by mean execution time and then EXPLAIN ANALYZE them, check the cache hit ratio (in Neon via the neon_stat_file_cache view, since Neon extends shared buffers with a local file cache), and look for table and index bloat caused by MVCC dead tuples. A hit ratio below 99% suggests the working set doesn't fit in memory, which calls for more shared_buffers or a larger Neon compute. Bloat is reduced with VACUUM, VACUUM FULL or REINDEX, all of which take locks. PgHero, run via Docker, gives a free dashboard alternative.

  • Debug your Postgres from the terminal: a tour of `neon inspect db`

    Neon mediumAdept

    `neon inspect db` adds fourteen read-only Postgres diagnostic subcommands to the Neon CLI, each running one curated query against Postgres statistics and catalog views (table/index sizes, bloat, unused indexes, seq scans, long-running queries, locks, pg_stat_statements outliers and calls, vacuum stats, replication slots, subscriptions). Connections resolve automatically for linked Neon projects, and most commands also work on any Postgres via `--db-url`. Output is bounded and available as JSON or YAML, which makes it safer for agents than raw SQL access. Neon-specific commands report Local File Cache hit rate (aim for 0.99+) and working set versus LFC size to signal when to scale compute, since Neon pins shared_buffers at 128 MB.

The quest for software engineering knowledge.

Look:
Layout: