PostgreSQL 15 - Features & Improvements November 12th, 2022 Mydbops Database Meetup -13 Aakash M Database Reliabiltiy Engineer, Mydbops
Database Reliabiltiy Engineer Interested in MySQL and PostgreSQL MySQL & AWS Certified Professional Tech Speaker/Blogger Aakash M About Me
• Services on top open source databases • Founded in 2016 • 80 Member team • Assisted over 500+ Customers • AWS Partner , ISO certified and a PCI Certified Organisation About Mydbops
Mydbops Services Consulting Services Managed Services Focuses on MySQL, MongoDB, PostgreSQL Targeted Engagement 24 x 7 DBA Team
Recap..
PostgreSQL 10 Native Partitioning Logical Replication Parallelism in Query Execution
PostgreSQL 11 Foreign Key support Covering Indexes Instant Column Addition Index Creation in parallel
PostgreSQL 12 Generated Column Support Removed Recovery.conf Reindex Concurrent
PostgreSQL 13 • Deduplication Parallel Vacuum Dynamic Replication Configuration
PostgreSQL 14 Reduced B-Tree Bloat Replicating ongoing transactions Idle_session_timeout
What is new in PostgreSQL 15 ?
PostgreSQL 15 Performance Improvements 01 System Administration 02 Logical Replication 03 Enhancements in SQL 04 Security 05
Performance
Improved Sorting Algorithms • Why does Sort Performance matter ? • Not only in Order By • Group by, Union, Window Function • improvements make sort operation faster
Improvement in Single Column Sort • Single Column Sort • Select column1 from table order by column1; • Not this • Select column1, column2 from table order by column1;
Improvement in Single Column Sort • Entire tuple during sort operation • Only particular column 's Datum • No need to copy entire tuple
Reduce Memory Consumption in Sorting • Two Memory Allocators • aset • Generation • Sorting used "aset" allocator • Allocates memory in the power of two (2^n) • Unnecessary memory allocation
Reduce Memory Consumption in Sorting • Changed to Generation Allocator • Never round up allocation size
Support for Parallelism • Since 9.6 • Select Distinct • Past only Single CPU/Process • Multiple numbers of workers in Parallel
System Administration
Stat Collector Gone V15 V14
Stat Collector Gone • Track all activities • pg_stat_* views • IO Usage on pg_stat_tmp
Stat Collector Gone • Staticstics in Shared Memory • stats_temp_directory parameter gone • Checkpoint process
Alter System • Introduced in PostgreSQL 9.4 • Only superuser can do it • GRANT ALTER SYSTEM on PARAMETER <parametername> to <role>;
Allow Archiving via modules • Running a shell command - archive_command • Performance Overhead • New parameter archive_library added • basic_archive contrib module
Backup and Logging Format Pg_basebackup: • supports server-side , client-side compression • Reduced network bandwidth
Backup and Logging Format Logging_format: • stderr, csvlog, syslog • New value - jsonlog added
Logical Replication
Filters in Logical Replication • Can filter rows and columns
Improved Error Handling • Replication break if any error occurs • Can skip the transaction • Alter SUBSCRIPTION .. SKIP • pg_replication_origin_advance()
Security
Revoke Public Create from Public Schema • Allowed to create objects in Public schema • Need to provide it explicitly
Revoke Public Create from Public Schema V14: V15:
Security Invoker Views • Security Definer - Executed with the privileges of the user that owns it • Security Invoker - Checks the privileges of the user of the view rather than owner
Security Invoker Views
Security Invoker Views
SQL Enchancements
Unique Null • NULL!=NULL • Unique Indexes and Constraints
Unique Null
Unique Null • Unique NULLS NOT DISTINCT • Unique NULLS DISTINCT
Merge • New SQL Command • Single SQL statement • When Matched - Action 1 in target table • When Not Matched - Action 2 in target table
How to Upgrade ?
How to Upgrade • Logical Dump/Restore • Binary In-Place Upgrade • Logical Replication
Logical Dump/Restore • Simple • Semi-online mode • Flexible • Extremely slow
Binary In-Place Upgrade • Very fast • Requires testing • No semi-online • Lose replicas
Logical Replication • Minimal Downtime • Complex method • A lot of requirements
References • https://www.postgresql.org/about/news/postgresql-15-released-2526/ • depesz.com/tag/pg15/ • https://www.cybertec-postgresql.com/en/a-primer-on-postgresql-upgrade- methods/
Reach Us : Info@mydbops.com Thank You

PostgreSQL 15 and its Major Features -(Aakash M - Mydbops) - Mydbops Opensource Database Meetup -13.