Re: Let's make PostgreSQL multi-threaded

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: Hannu Krosing <hannuk(at)google(dot)com>
Cc: James Addison <jay(at)jp-hosting(dot)net>, Konstantin Knizhnik <knizhnik(at)garret(dot)ru>, Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Let's make PostgreSQL multi-threaded
Date: 2023-07-28 18:10:44
Message-ID: CAEze2WjJZZ=P_ich+=RiA51APHsNV7zi=-j-24DCPsaV43c+Ow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 15 Jun 2023 at 11:07, Hannu Krosing <hannuk(at)google(dot)com> wrote:
>
> One more unexpected benefit of having shared caches would be easing
> access to other databases.
>
> If the system caches are there for all databases anyway, then it
> becomes much easier to make queries using objects from multiple
> databases.

We have several optimizations in our visibility code that allow us to
remove dead tuples from this database when another database still has
a connection that has an old snapshot in which the deleting
transaction of this database has not yet committed. This is allowed
because we can say with confidence that other database's connections
will never be able to see this database's tables. If we were to allow
cross-database data access, that would require cross-database snapshot
visibility checks, and that would severely hinder these optimizations.
As an example, it would increase the work we need to do for snapshots:
For the snapshot data of tables that aren't shared catalogs, we only
need to consider our own database's backends for visibility. With
cross-database visibility, we would need to consider all active
backends for all snapshots, and this can be significantly more work.

Kind regards,

Matthias van de Meent
Neon (https://neon.tech/)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Farias de Oliveira 2023-07-28 18:37:39 Re: In Postgres 16 BETA, should the ParseNamespaceItem have the same index as it's RangeTableEntry?
Previous Message Nathan Bossart 2023-07-28 18:00:56 Re: Fwd: BUG #18016: REINDEX TABLE failure