Should PostgreSQL Become Multi-Threaded?

June 14, 2023
Author
Peter Zaitsev
Share this Post:

Postgresql multi-threaded

A few days ago, Heikki Linnakangas posted a message in the PostgreSQL mailing list titled “Let’s make PostgreSQL multi-threaded.”  This topic got quite a discussion on Hacker News too.

The poll I’ve done on Twitter shows there is great interest in this topic and overwhelming support for such an effort!

I am very excited to see this discussion finally happening! 

From a technical standpoint, I think multi-threaded architecture is quite superior; the cost of process context switch is a lot more expensive than thread context switch.  PostgreSQL has great performance despite this, yes, but it is surely an opportunity to improve performance, especially for some workloads.

It is a big change, though; PostgreSQL and PostgreSQL plugins relied on multi-process rather than multi-threaded architecture for years, and if PostgreSQL Global Development Group embarks on the effort, it will not be quick.  Heikki himself acknowledges it would take multiple major PostgreSQL releases for work to be complete.

The downside of embarking on such an effort is opportunity cost. Scarce development resources could be spent on something else and potentially impact the stability of PostgreSQL and, even more so, the plugin ecosystem.

In my mind, though, there is no question this work will need to be done at some point. The database is performance-critical software; you must use the most high-performance operating system concepts to get the best performance possible.  It also will unlikely get easier as the codebase only grows and becomes more complicated through the years (unless, of course, AI becomes capable of performing such a major re-architecturing task.)

So is it time to bite the bullet and make PostgreSQL multi-threaded? What do you think?

Discover the power of Percona and PostgreSQL – Download the ‘Why Customers Choose Percona for PostgreSQL’ white paper to learn more.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Far
Enough.

Said no pioneer ever.
MySQL, PostgreSQL, InnoDB, MariaDB, MongoDB and Kubernetes are trademarks for their respective owners.
© 2026 Percona All Rights Reserved