Re: VACUUM FULL, CLUSTER, and REPACK block on other sessions' temp tables - Mailing list pgsql-hackers

From Jim Jones
Subject Re: VACUUM FULL, CLUSTER, and REPACK block on other sessions' temp tables
Date
Msg-id 9de2a59f-9597-4101-bf34-cf3804752e64@uni-muenster.de
Whole thread Raw
In response to Re: VACUUM FULL, CLUSTER, and REPACK block on other sessions' temp tables  (Zsolt Parragi <zsolt.parragi@percona.com>)
Responses Re: VACUUM FULL, CLUSTER, and REPACK block on other sessions' temp tables
List pgsql-hackers
Hi

On 25/03/2026 21:38, Zsolt Parragi wrote:
> Shouldn't the patch also include a tap test to verify that the change
> works / fails without it?

Definitely. I just didn't want to invest much time on tests before
getting feedback on the issue itself.

> + /* Skip temp relations belonging to other sessions */
> + {
> + Oid nsp = get_rel_namespace(index->indrelid);
> +
> + if (!isTempOrTempToastNamespace(nsp) && isAnyTempNamespace(nsp))
> + {
> 
> Doesn't this result in several repeated syscache lookups?
> 
> There's already a SearchSysCacheExsists1 directly above this, then a
> get_rel_namespace, then an isAnyTempNamespace. While this probably
> isn't performance critical, this should be doable with a single
> SearchSysCache1(RELOID...) and then a few conditions, similarly to the
> else branch below this?

You're right. Although it is not performance critical we can solve it
with a single SearchSysCache1.

PFA v3 with the improved fix (0001) and tests (0002).

Thanks for the review!

Best, Jim
Attachment

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: POC: Parallel processing of indexes in autovacuum
Next
From: Michael Paquier
Date:
Subject: Re: Adding locks statistics