PostgreSQL 13 – New Features [Master Guide]

PostgreSQL 13 Beta 1 has been released for testing.

PostgreSQL 13 New Features

More than 160 new features have been added in PostgreSQL 13 compared to its previous versions.

This is a multi-post series on PostgreSQL 13 NF, so I would recommend you to subscribe to the mailer given down below so that you get notified whenever I release a new post in the series.

I will just compare the major difference between PostgreSQL 12 (12.3) and PostgreSQL 13 Beta 1 (13.0). However, I am not going to describe all the features here, I will list down the features which plays a significant role in performance improvement.

Hardware/Software used to test the PostgreSQL 13 New Features.

  • Operating System      : RHEL 6
  • Disk                            : SSD
  • PostgreSQL Versions :  v12.3 vs v13 Beta 1

New Feature 1: Incremental Sorting

PostgreSQL 13 in its release notes highlighted Incremental sorting as one of the main new features in PostgreSQL 13.

PostgreSQL 13’s incremental sorting, which accelerates sorting data when data that is sorted from earlier parts of a query are already sorted.

For example, you have an index on c1 and you need to sort dataset by c1, c2. Then incremental sort can help you because it wouldn’t sort the whole dataset, but sort individual groups whose have the same value of c1 instead. The incremental sort is extremely helpful when you have a LIMIT clause.

Lets us run the query the following query in PostgreSQL 12 and PostgreSQL 13 Beta 1.

select * from pgbench_accounts order by aid, bid; 

here aid has an index whereas bid doesn’t have one.

PostgreSQL 12.3

PostgreSQL 13 Beta 1

By not sorting the entire table at once, but in blocks, it increases the chance that the sorted block will fit in memory, and it will be possible to use quicksort instead of the slower, more demanding external sort.

You can enable or disables the query planner’s use of incremental sort steps with the below parameter. The default is on.

enable_incrementalsort (boolean)

Stay tuned for more new feature test cases, you can do so by subscribing here [email-subscribers-form id=”1″]

Words from postgreshelp

Thank you for giving your valuable time to read the above information. I hope the content served your purpose in reaching out the blog.
Suggestions for improvement of the blog are highly appreciable. Please contact us for any information/suggestions/feedback.

If you want to be updated with all our articles

please follow us on Facebook Twitter
Please subscribe to our newsletter.

 

Leave a Reply