On Thu, 15 Jun 2023 at 11:07, Hannu Krosing <han...@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/)