{"id":2886,"date":"2025-06-24T05:55:12","date_gmt":"2025-06-24T05:55:12","guid":{"rendered":"https:\/\/bynatree.com\/?p=2886"},"modified":"2025-06-24T05:55:12","modified_gmt":"2025-06-24T05:55:12","slug":"whats-new-in-postgresql-18-beta-performance-insight-and-control","status":"publish","type":"post","link":"https:\/\/divaind.com\/ie1\/2025\/06\/24\/whats-new-in-postgresql-18-beta-performance-insight-and-control\/","title":{"rendered":"What\u2019s New in PostgreSQL 18 Beta: Performance, Insight and Control"},"content":{"rendered":"<blockquote><p><span style=\"font-weight: 400;\">PostgreSQL 18 , which is presently in Beta, offers a robust feature set that enhances security, replication, performance, and observability(PostgreSQL 18 Beta). The main improvements are already obvious\u2014and exciting\u2014even though the final GA (General Availability) release may fine-tune several elements.<\/span><\/p><\/blockquote>\n<p><span style=\"font-weight: 400;\">Here\u2019s a concise overview of what\u2019s coming:<\/span><\/p>\n<h2><b>\u26a1 Performance Enhancements<\/b><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Asynchronous I\/O<\/b><span style=\"font-weight: 400;\">: A major milestone. PostgreSQL now supports asynchronous I\/O with the <\/span><span style=\"font-weight: 400;\">io_method<\/span><span style=\"font-weight: 400;\"> setting. This allows background reads using <\/span><span style=\"font-weight: 400;\">io_uring<\/span><span style=\"font-weight: 400;\"> or worker threads, unlocking faster read-heavy workloads. Stats are exposed via the new <\/span><span style=\"font-weight: 400;\">pg_aios<\/span><span style=\"font-weight: 400;\"> view.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>B\u2011tree Index Skip Scans<\/b><span style=\"font-weight: 400;\">: Improves query speed by skipping unnecessary parts of multi-column indexes.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Parallel GIN Index Creation<\/b><span style=\"font-weight: 400;\">: Index creation for GIN types can now leverage multiple CPUs.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Faster GiST and B\u2011tree Builds<\/b><span style=\"font-weight: 400;\">: New sort support boosts performance for range-type index creation.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/li>\n<\/ul>\n<h2><b>\ud83d\udcca Monitoring &amp; Observability<\/b><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Detailed I\/O Statistics<\/b><span style=\"font-weight: 400;\">: New <\/span><span style=\"font-weight: 400;\">pg_stat_get_backend_io()<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">pg_stat_io<\/span><span style=\"font-weight: 400;\"> columns (<\/span><span style=\"font-weight: 400;\">read_bytes<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">write_bytes<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">extend_bytes<\/span><span style=\"font-weight: 400;\">) provide per-backend I\/O insights.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>WAL &amp; Checkpointer Stats<\/b><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">pg_stat_get_backend_wal()<\/span><span style=\"font-weight: 400;\"> and enhanced <\/span><span style=\"font-weight: 400;\">pg_stat_checkpointer<\/span><span style=\"font-weight: 400;\"> report more detailed write-ahead log activity.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Improved Memory Reporting<\/b><span style=\"font-weight: 400;\">: Functions like <\/span><span style=\"font-weight: 400;\">pg_get_process_memory_contexts()<\/span><span style=\"font-weight: 400;\"> and new columns in <\/span><span style=\"font-weight: 400;\">pg_backend_memory_contexts<\/span><span style=\"font-weight: 400;\"> help debug memory use.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Vacuum &amp; Analyze Timing<\/b><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">pg_stat_all_tables<\/span><span style=\"font-weight: 400;\"> now logs time spent in both manual and automatic vacuum\/analyze operations.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>EXPLAIN Enhancements<\/b><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">EXPLAIN ANALYZE VERBOSE<\/span><span style=\"font-weight: 400;\"> now includes WAL usage, CPU time, memory usage, and disk activity\u2014especially for Materialize, CTEs, and Window nodes.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<\/ul>\n<h2><b>\ud83d\udd10 Security Upgrades<\/b><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>OAuth Authentication<\/b><span style=\"font-weight: 400;\">: A new <\/span><span style=\"font-weight: 400;\">oauth<\/span><span style=\"font-weight: 400;\"> method has been added to <\/span><span style=\"font-weight: 400;\">pg_hba.conf<\/span><span style=\"font-weight: 400;\">, allowing integration with external token validators via <\/span><span style=\"font-weight: 400;\">oauth_validator_libraries<\/span><span style=\"font-weight: 400;\">.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Minimum Password Length<\/b><span style=\"font-weight: 400;\">: Configurable through the new <\/span><span style=\"font-weight: 400;\">min_password_length<\/span><span style=\"font-weight: 400;\"> variable for better password policies.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Access Control Auditing<\/b><span style=\"font-weight: 400;\">: The new <\/span><span style=\"font-weight: 400;\">pg_get_acl()<\/span><span style=\"font-weight: 400;\"> function simplifies ACL inspection.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>MD5 Authentication Deprecated<\/b><span style=\"font-weight: 400;\">: PostgreSQL continues to tighten security\u2014MD5 will be removed in future versions.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<\/ul>\n<h2><b>\ud83d\udd01 Replication<\/b><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Generated Columns Support<\/b><span style=\"font-weight: 400;\">: Logical replication now supports generated columns\u2014great for syncing with systems that can\u2019t recompute them.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Replication Origin Limits<\/b><span style=\"font-weight: 400;\">: Use <\/span><span style=\"font-weight: 400;\">max_active_replication_origins<\/span><span style=\"font-weight: 400;\"> to control how many logical origins can be tracked simultaneously.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Conflict Logging<\/b><span style=\"font-weight: 400;\">: Apply conflicts are now logged and available in <\/span><span style=\"font-weight: 400;\">pg_stat_subscription_stats<\/span><span style=\"font-weight: 400;\">, improving visibility.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Cleaner Wal files Handling<\/b><span style=\"font-weight: 400;\">: Idle replication slots can now auto-expire using <\/span><span style=\"font-weight: 400;\">idle_replication_slot_timeout<\/span><span style=\"font-weight: 400;\">.<\/span><\/li>\n<\/ul>\n<h2><b>\ud83d\udd27 Vacuum &amp; Maintenance<\/b><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The highest limit for autovacuum workers is defined via a new server option called <\/span><b>autovacuum_worker_slots<\/b><span style=\"font-weight: 400;\">. This makes it easier to scale vacuum operations according to load because you can now modify autovacuum_max_workers at runtime without having to restart.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, you may use the <\/span><b>autovacuum_vacuum_max_threshold <\/b><span style=\"font-weight: 400;\">argument to establish a specific threshold for dead tuples that will cause the autovacuum to start. By adding to the current percentage-based triggering method, this gives high-churn tables greater control over vacuum behavior.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Recently, the <\/span><b>vacuum_truncate <\/b><span style=\"font-weight: 400;\">You can choose whether PostgreSQL attempts to truncate empty pages at the end of a table file while vacuuming it. Turning off truncation, which requires an exclusive lock, gives you more control over vacuum behavior and helps avoid unnecessary locking on frequently visited databases.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/li>\n<\/ul>\n<h2><b>\ud83d\udd04 <\/b><b>pg_upgrade<\/b><b> Improvements<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">PostgreSQL 18 significantly improves the <\/span><span style=\"font-weight: 400;\">pg_upgrade<\/span><span style=\"font-weight: 400;\"> experience\u2014reducing downtime and giving DBAs more control:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Preserve Optimizer Statistics<\/b><b><br \/>\n<\/b> <span style=\"font-weight: 400;\">pg_upgrade<\/span><span style=\"font-weight: 400;\"> can now retain existing planner statistics (excluding extended statistics). This helps avoid slow query performance right after an upgrade. Use <\/span><span style=\"font-weight: 400;\">&#8211;no-statistics<\/span><span style=\"font-weight: 400;\"> if you prefer to skip this step.<\/span><span style=\"font-weight: 400;\"><\/p>\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Parallel Database Checks<\/b><b><br \/>\n<\/b><span style=\"font-weight: 400;\"> Pre-upgrade compatibility checks across databases can now be parallelized using the existing <\/span><span style=\"font-weight: 400;\">&#8211;jobs<\/span><span style=\"font-weight: 400;\"> option, speeding up validation in large clusters.<\/span><span style=\"font-weight: 400;\"><\/p>\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Fast Directory Swapping<\/b><b><br \/>\n<\/b><span style=\"font-weight: 400;\"> A new <\/span><span style=\"font-weight: 400;\">&#8211;swap<\/span><span style=\"font-weight: 400;\"> option enables <\/span><span style=\"font-weight: 400;\">pg_upgrade<\/span><span style=\"font-weight: 400;\"> to switch data directories directly instead of copying or linking files. This is potentially the fastest upgrade method\u2014ideal for large databases where speed matters.<\/span><span style=\"font-weight: 400;\"><\/p>\n<p><\/span><\/li>\n<\/ul>\n<h2><b>\ud83d\udce6 Backup Tool Improvements<\/b><\/h2>\n<h3><b>\ud83d\uddc2\ufe0f <\/b><b>pg_dump<\/b><b> Enhancements<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Fine-Grained Control<\/b><span style=\"font-weight: 400;\">: New options let you selectively dump:<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">&#8211;with-data<\/span><span style=\"font-weight: 400;\">: Dump only table data<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">&#8211;with-schema<\/span><span style=\"font-weight: 400;\">: Dump only schema definitions<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">&#8211;with-statistics<\/span><span style=\"font-weight: 400;\">: Include planner statistics<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Exclusion Options<\/b><span style=\"font-weight: 400;\">:<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">&#8211;no-data<\/span><span style=\"font-weight: 400;\">: Exclude data<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">&#8211;no-schema<\/span><span style=\"font-weight: 400;\">: Exclude schema<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">&#8211;statistics-only<\/span><span style=\"font-weight: 400;\">: Dump only statistics<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">&#8211;no-statistics<\/span><span style=\"font-weight: 400;\">: Exclude statistics (useful for leaner dumps)<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">These allow precise control over what parts of a database you want to export.<\/span><\/p>\n<h3><b>\ud83d\uddc3\ufe0f <\/b><b>pg_dumpall<\/b><b> Enhancements<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Output Format Flexibility<\/b><span style=\"font-weight: 400;\">:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span> <span style=\"font-weight: 400;\">pg_dumpall<\/span><span style=\"font-weight: 400;\"> can now export in the same output formats as <\/span><span style=\"font-weight: 400;\">pg_dump<\/span><span style=\"font-weight: 400;\">, such as directory or custom formats\u2014previously, it only supported plain text.<\/span><span style=\"font-weight: 400;\"><\/p>\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Compatibility with <\/b><b>pg_restore<\/b><span style=\"font-weight: 400;\">:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\"> Dumps created using the new formats can now be restored using <\/span><span style=\"font-weight: 400;\">pg_restore<\/span><span style=\"font-weight: 400;\">, streamlining the backup\/restore pipeline for entire clusters.<\/span><\/li>\n<\/ul>\n<h2><b>\ud83e\udde0 Other Noteworthy Additions<\/b><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Virtual Generated Columns<\/b><span style=\"font-weight: 400;\">: Default behavior now supports virtual (read-computed) columns; <\/span><span style=\"font-weight: 400;\">STORED<\/span><span style=\"font-weight: 400;\"> still supported when needed.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Extension Paths<\/b><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">extension_control_path<\/span><span style=\"font-weight: 400;\"> allows control files in custom locations.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>File Copy Control<\/b><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">file_copy_method<\/span><span style=\"font-weight: 400;\"> defines how files are handled during CREATE DATABASE or tablespace changes.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/li>\n<\/ul>\n<h2><b>\u2705 Final Thoughts<\/b><\/h2>\n<blockquote><p><span style=\"font-weight: 400;\">It appears that PostgreSQL 18 will be a game-changer, particularly for teams that prioritize deep system observability, safe access, and performance optimization. Many of these features are developed enough to start testing against your staging environments, even if it&#8217;s still in beta.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">We discussed a high-level summary of the most intriguing additions in this piece. We&#8217;ll go into more detail about each innovation in the upcoming weeks, including asynchronous I\/O, improved logical replication, autovacuum optimization, and improved EXPLAIN analytics, along with use examples and performance advice.<\/span><\/p>\n<p style=\"text-align: center;\"><strong>Stay tuned for more insights as we explore PostgreSQL 18 in depth.<\/strong><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>PostgreSQL 18 , which is presently in Beta, offers a robust feature set that enhances security, replication, performance, and observability(PostgreSQL 18 Beta). The main improvements are already obvious\u2014and exciting\u2014even though the final GA (General Availability) release may fine-tune several elements. Here\u2019s a concise overview of what\u2019s coming: \u26a1 Performance Enhancements Asynchronous I\/O: A major milestone.&hellip;<\/p>\n","protected":false},"author":1,"featured_media":2887,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[115,116,120,227,228,231,268,272,275,305],"class_list":["post-2886","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql","tag-database-optimization","tag-database-performance","tag-database-security","tag-new-features","tag-observability","tag-open-source-database","tag-postgresql-18","tag-postgresql-beta","tag-postgresql-ga","tag-replication","category-28","description-off"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/posts\/2886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/comments?post=2886"}],"version-history":[{"count":0,"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/posts\/2886\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/media\/2887"}],"wp:attachment":[{"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/media?parent=2886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/categories?post=2886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/tags?post=2886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}