Re: Let's make PostgreSQL multi-threaded - Mailing list pgsql-hackers

From Matthias van de Meent
Subject Re: Let's make PostgreSQL multi-threaded
Date
Msg-id CAEze2WjJZZ=P_ich+=RiA51APHsNV7zi=-j-24DCPsaV43c+Ow@mail.gmail.com
Whole thread Raw
In response to Re: Let's make PostgreSQL multi-threaded  (Hannu Krosing <hannuk@google.com>)
List pgsql-hackers
On Thu, 15 Jun 2023 at 11:07, Hannu Krosing <hannuk@google.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/)



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: New PostgreSQL Contributors
Next
From: Farias de Oliveira
Date:
Subject: Re: In Postgres 16 BETA, should the ParseNamespaceItem have the same index as it's RangeTableEntry?