Re: MVCC and all that...

From: Justin <zzzzz(dot)graf(at)gmail(dot)com>
To: Ellen Allhatatlan <ellenallhatatlan(at)gmail(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: MVCC and all that...
Date: 2025-09-10 15:29:41
Message-ID: CALL-XeN=8nYHVw0Gn510feRbXJSRzEf8XeJxooWVpoZ=p_98Mw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Sep 10, 2025 at 3:41 AM Ellen Allhatatlan <
ellenallhatatlan(at)gmail(dot)com> wrote:

> Hi, and thanks for your input,
>
> Just before I reply - if you (at least here in Ireland - Google's
> answers vary per location, unlike Duckduckgo's) search for "firebird
> mvcc mechanism" the "AI assistant" tells me twice that FB's MVCC
> implementation is "like PostgreSQL's"... I'll investigate further and
> report back. Igor Rogov's book looks like a good place to start!
>
> > I read through the article its click bait/flame war just waiting to
> happen.
> > Article is a list of cherry picked PG drawbacks that can be mitigated or
> worked around.
>
> Pity - I took the guy at his word when he said that PostgreSQL was
> just different, not better or worse.
>
> > On the bulk updating. I'm shaking my finger at any one that locks up
> 25% of a table with an update or delete. That is asking for problems in a
> production database with a high TPS rate.
>
> OK - I'm going to run the benchmarks myself and see what happens - but
> I"m sure he didn't pick that test for nothing - come to think of it,
> the table stable structure is bizarre!
>

My point here is not to criticize that article as being wrong, PG will
bloat the table and be slower than firebird PG. My criticism is this
argument/example is not reflective of the real world. What DBA/Programmer
would not be in trouble locking 25% of a table for a prolonged period of
time doing an update. This approach would all but guarantee an outage or
other issues across the database. This argument is bogus and very much
against best practices updating large amounts of data in a single
transaction creates blockers for other sessions.

>
> > The author brings up threaded vs multi-process. That's an old old old
> old old conversation that has been shown there is no clear better way.
>
> This is where things become interesting. Firebird actually has 3
> process/threading models - and they manage to maintain these with a
> team that is *_much_* smaller than the PostgreSQL one - FB is a minnow
> compared to PG!
>
> AIUI, Michael Stonebraker suggested that the process model
> would/should be "upgraded" to a threaded one at some point in the
> system's developement?
>

I am going to need a source on this. Process vs Threads: pro and cons are
very well documented and proven today.

>
>
> > Backup argument is cherry picking and not discussing pgBackrest and
> other solutions or the use of tablespaces to isolate databases in a
> cluster at the disk layer or disk snapshots.
>
> OK again. I'm just wondering if the single file per database isn't a
> fundamental architectural flaw in itself? AIUI, you could have
> mulitple files (back in 32-bit land) "chained" - but (again AIUI) the
> same table could be spread over x files - all "intermingled"... weird.
>

Single file approach vs multiple file approach. This boils down to
preference; there is no clear plus and minus to either approach. the Path
to the actual data has to go through several Maps.
Multiple Files. Disk Internal Structure, => File System( ZFS EXT FAT
etc..), => Table mapped to a File or group of Files,=> DataPage mapped to
data type and columns,
Single File Disk Internal Structure => File System( ZFS EXT FAT etc..),
Single File => Mapping Tables to locations in the single file => DataPage
mapped to data type and columns.

Single file has the advantage removing IO context switching at the OS
level, however it moves the Context switch to the database side
jumping around in the single file itself to find the necessary data.

This does not reduce IO

>
> > "PostgreSQL has a relatively simple, but fast query planning algorithm"
> Compared to what.... What feature is PG missing these days... the only
> thing I know it can't do is change the plan in the middle of the
> execution stage. Which is not a query planner thing but the execution
> layer saying to itself I am taking too long maybe go back to the planning
> stage... Query Hints that have been discussed endlessly. Adding hints
> adds its own problems and has become a big mess for databases that support
> it.
>
>
My criticism here "The claim postgresql query planner is simple" is not
backed up with actual examples and data. Looks at a specific case which
does not even involve the query planner.

>
> > Multiple transactions per connection. I am asking WHY is that a
> feature. when one can have multiple sessions, what is the difference?
> running multiple transactions in single or multiple sessions means moving
> part of transaction logic into the application space. What do we gain
> here.....
>
> No idea - I'll take your word for it!
>

Making a logical argument here, the statement this feature is a plus
without any examples to backup the claim. I'm trying to show a counter
example why would this be a plus when we can do the same thing just
differently. It ignores the obvious issue of moving the transaction logic
into the app has big drawbacks.

>
> Accepted now - thanks for your input.
>
>
> --
>
> El!
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2025-09-10 15:55:28 Re: MVCC and all that...
Previous Message Adrian Klaver 2025-09-10 15:15:35 Re: MVCC and all that...