Re: Inquiry on Future Plans for Enhancements to PostgreSQL MVCC Model and Vacuum Process - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Inquiry on Future Plans for Enhancements to PostgreSQL MVCC Model and Vacuum Process
Date
Msg-id a2e55f5d-ea31-4b97-b540-f146db665ebd@iki.fi
Whole thread Raw
In response to Inquiry on Future Plans for Enhancements to PostgreSQL MVCC Model and Vacuum Process  (송영욱 <pidaoh@g.skku.edu>)
List pgsql-hackers
On 01/11/2024 14:56, 송영욱 wrote:
> Hi hackers,
> 
> I’m currently studying the internals of PostgreSQL, specifically the 
> vacuum process.
> 
> I've learned that PostgreSQL’s MVCC model has had issues in the past, 
> such as XID wraparound and table bloating problems. It seems that these 
> issues may have been mitigated by implementing features like autovacuum.
> 
> However, from my understanding, the current MVCC model seems to have 
> more negative effects than positive ones. Is there any plan to modify 
> the MVCC model in future versions?

There are no ongoing efforts for a big rewrite. If we were writing 
PostgreSQL from scratch, we'd probably do many things differently, but 
it's very difficult to change something so ingrained as MVCC. Even if 
you come up with a scheme that works better for 95% of users, that last 
5% of users will be unhappy, which is bad. That means either maintaining 
two systems forever, or throwing some users under the bus.

There are always efforts further to mitigate the issues though. See this 
thread 
https://www.postgresql.org/message-id/CAJ7c6TND0bCnwU1SmxTsFewK4XJGBep343vf+T+GQ-a5S5hC0w@mail.gmail.com 
for an effort to switch to 64-bit XIDs, for example. That largely 
eliminates XID wraparound.

There was a notable project called zheap a few years ago to replace the 
heap implementation with a new table AM 
(https://wiki.postgresql.org/wiki/Zheap). AFAIK no one is working on 
that at the moment however. Alexander Korotkov's OrioleDb is also worth 
mentioning. It's an even bigger rewrite with various pros and cons 
however, which means it's unlikely to replace PostgreSQL's current MVCC.

My personal favorite in this area is TED 
(https://www.postgresql.org/message-id/55511D1F.7050902%40iki.fi). 
That's a pretty modest change to how MVCC currently works, so it won't 
solve all the issues, but it's a small enough change that I think 
there's a better chance of getting it done. However, it's just an idea; 
there has been zero work on actually implementing it.

At the end of the day, this is an open source project, so the future 
depends on what people decide to work on and submit patches for. The 
above are just the notable efforts that I'm aware of.

-- 
Heikki Linnakangas
Neon (https://neon.tech)




pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PG does not support one function of its extension pg_hint_plan
Next
From: Greg Sabino Mullane
Date:
Subject: Re: Making error message more user-friendly with spaces in a URI