On Tue, Mar 7, 2023 at 12:42 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@gmail.com> writes:
> > As mentioned, this approach allows for more improvements in later
> > patches. There is absolutely no reason for transactions in separate
> > databases to be in each others' possibleUnsafeConflicts lists.
>
> What if they both touched/modified a shared catalog?
I was assuming that that would already skip all predicate locking because:
/*
* Does this relation participate in predicate locking? Temporary and system
* relations are exempt.
*/
static inline bool
PredicateLockingNeededForRelation(Relation relation)
{
return !(relation->rd_id < FirstUnpinnedObjectId ||
RelationUsesLocalBuffers(relation));
}
If we ever wanted to use SSI on catalogs, or allow shared relations
that aren't catalogs, or allow cross-database access, then this
optimisation wouldn't fly.