Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wBAUT-000nxl-0Z for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Apr 2026 11:57:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wBAUR-00BcMN-0g for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Apr 2026 11:57:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wBAUQ-00BcMD-2z for pgsql-hackers@lists.postgresql.org; Fri, 10 Apr 2026 11:57:35 +0000 Received: from mail-dy1-x1342.google.com ([2607:f8b0:4864:20::1342]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wBAUP-00000000KHX-3Lql for pgsql-hackers@lists.postgresql.org; Fri, 10 Apr 2026 11:57:34 +0000 Received: by mail-dy1-x1342.google.com with SMTP id 5a478bee46e88-2bdcf5970cdso1047219eec.0 for ; Fri, 10 Apr 2026 04:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775822253; cv=none; d=google.com; s=arc-20240605; b=GJ/Ddj+sdcqI240LYusWhnX0WYRu8SrO4wNiScSZA1W8mXbII//OZGgqlf7mDqnq9h G8Bbw7IBWQhGGvbrSLWHdoMG21MxvemJ4MB5sNTew0OSLDXXSQF0CvCKulWdDKMgPQno 4GZKsljkh3zAdfmKYMBEi2Jp1/pTK74sdkKQgTam0ORkBBLALVcqx4WB/6fKlxaYAxJD g4vHl96LJl0+H8D7Y//ATJynvWM1rjGqTZpOmxfkS7I0fM5bvx/REr5Qa7S6FvalC7fU 2LIxoayKpap1YS072YCu2evmCxD7Z/2Bed0cCY9CwDqueKhDOJL0AZ+yk8mcZ5fNjSe1 pAvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=kArKjGNnYPaouJ6tB736oSWAXRDviENQFpVixHzBS2o=; fh=v5EgQa8wgq5Lar71dTvuTKNfxSVjfJRkBRg8IQEXPUo=; b=EUF69bAoOi1kJfDFHrqigRPKLRPaNn27+YpHX6jOS+Ecaasv7kgApgf6exCpPoQuyf btIFswJPz1kaX5FM6+5WAPHnw883xw6jlQa9b1eix07dGCKKEhWoEMOwq+VxpxdGs67S ZDLCXkQyg0Zwjx+Nke4eKz5zPz2nih8KrvDiwk5RqBtpSJ174Xa9bw6uj3JWP2ISl2bp AARpzl6g/AN6ftK7GnmCbQhtRiHE9kD5skBQKdSz9KfzmvqARqUGTj5ZweytjPGd1E69 2K6EWj5qmx8nOGyVqM4XlutRQI1cs+9Rpb9P8JdkUQnGnUPfRxC2Qn9xfP/qSmQdSvcR WYRw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775822253; x=1776427053; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kArKjGNnYPaouJ6tB736oSWAXRDviENQFpVixHzBS2o=; b=f/cCAdrTVo8r+NPVW05oHE6JxiUUGO1DHGj1r6KNMwHo4n8obgXMmOaALEq9pUEwoo gW6vletZk8Rvf6OJDvpLBWhKA48umsq9ov6PfnN/6SKkbCQsCC7r7+aK5INgQvJENVWB 7C+E1buRGilvs6ALP9HxbLTpL8arAQiRxgv0553fv+NiVGJS+TMpox5JQIwYlXMMteIU G5VWTa6FIBrRIF77SIz2Nl00991iAiMTQhklcIJR+Sg6cWIf9IkukWRgBqTIqLg8RqkN +/4WNtKlffYikNVSa9Gi/lCdJty6b3Tgl/peU0B7JclH4etK+aW5uKRSYf++Kewetikt kyGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775822253; x=1776427053; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=kArKjGNnYPaouJ6tB736oSWAXRDviENQFpVixHzBS2o=; b=F6qGZWOuENiuUkxX0W903hqWED3+N70vbJU6RkjzpvtGsVgSfFxcWq/0MXoZ45UO6X QzVchM8mlBiCsMut+A77MSf37iMAw8aupmDo/+iBPrGLxKqRsJjVqswZhKw0PbLBvWp1 TOXYt5N0F90IgdBYAsUF6K+ZOS657YyveVtZm6/uo+1cS18eQmbC0sO+NNzsSQ533as6 ciOMxiyk1xzghb5ocSqB1j5+qEH79j+GFzWPs7xCiBj4UB9fKnkjlRRCYK/kSY6z4JXv Mw/vFrFJ8AkTvsduirK+7lrLRb7EvEwZ3CQqx6WIueL5nMLFTNRq+35raMb5fY8HPj6S pSrg== X-Gm-Message-State: AOJu0YzeJtBCC7HbccRQtGBpjifrLFz1RDwsAAfF4wtE/IDcEwY05HhX CdvjkNHChW+AEZdG/GxVv0pCeW4VwYkz2YEevTVvvmYuVXHonlLJDSDtekxuH9pKs/Du5cNq6u3 KH6IRFfT+WNrPHWinT1qxhJ1KIID4at4= X-Gm-Gg: AeBDietgnDwRnxVhbHU5HdG57JmDeqRsxhoXQMEZPEN4wiFJ1V1R/KgzZm/UmzE0ON6 C+TxkKqeFwnbj8gV2icPoUkcqpvFVlvvqwJMxzfTrcJbq58fHbudlMSIxQbj8cK+zKGmgvGrVxt HnMxflAVmF+k5nk0+dnNfSnTsROX8pJZvEq7Mbc52Cd1VWe1b2IAwa2SCIjAVnv5N7WdQKvuMuJ Ox8Mr3w2Sd7mj7Fbaey3ctWHcnjZExfrT1RjIHW4AKjF81YXzp4Uas62P2jllRtlZLH78SAw89a 4NviVQ== X-Received: by 2002:a05:7300:fb89:b0:2c1:7480:ff9b with SMTP id 5a478bee46e88-2d4106c7c60mr3313584eec.18.1775822253315; Fri, 10 Apr 2026 04:57:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dapeng Wang Date: Fri, 10 Apr 2026 19:57:22 +0800 X-Gm-Features: AQROBzDIZTsfdO1LrkwPadX9pV5V6JEvkmHNhcuKg0Gw_REiOvar_MvEpPoFcH8 Message-ID: Subject: Re: Add missing CHECK_FOR_INTERRUPTS in autovacuum catalog scan loops To: Lakshmi N Cc: pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000097dbd7064f19d683" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000097dbd7064f19d683 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Lakshmi N =E4=BA=8E2026=E5=B9=B44=E6=9C=8810=E6=97= =A5=E5=91=A8=E4=BA=94 16:39=E5=86=99=E9=81=93=EF=BC=9A > Hi hackers, > > I noticed CFI is missing while scanning pg_class for RELKIND_RELATION and > RELKIND_TOASTVALUE. On a database with several thousands of tables, these > scans can take a noticeable amount of time. Attached a patch to address > this. > > Regards, > Lakshmi > Hi Lakshmi, The patch applies cleanly to HEAD and compiles without warnings. make check passes (one unrelated ICU collation diff). The two CHECK_FOR_INTERRUPTS() additions in do_autovacuum() look correct and are well-placed at the top of each loop iteration, before any resources are acquired. I noticed there are other similar catalog scan loops in autovacuum.c that also lack CHECK_FOR_INTERRUPTS(): - The pg_database scan loop around line 1854 - The pg_class scan loop around line 3664 Should those be covered as well? Regards, Dapeng Wang --00000000000097dbd7064f19d683 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Lakshmi N <lakshmin.jhs@gmail.com> =E4=BA=8E2026=E5=B9=B44=E6=9C= =8810=E6=97=A5=E5=91=A8=E4=BA=94 16:39=E5=86=99=E9=81=93=EF=BC=9A
Hi hackers,

I notic= ed CFI is missing=C2=A0while scanning pg_class for RELKIND_RELATION and REL= KIND_TOASTVALUE. On a database with several thousands of tables, these scan= s can take a noticeable amount of time. Attached a patch to address this.

Regards,
Lakshmi
= Hi Lakshmi,

The patch applies cleanly to HEAD and compiles without w= arnings.
make check passes (one unrelated ICU collation diff).

Th= e two CHECK_FOR_INTERRUPTS() additions in do_autovacuum() look
correct a= nd are well-placed at the top of each loop iteration,
before any resourc= es are acquired.

I noticed there are other similar catalog scan loop= s in
autovacuum.c that also lack CHECK_FOR_INTERRUPTS():

- The pg= _database scan loop around line 1854
- The pg_class scan loop around lin= e 3664

Should those be covered as well?

Regards,
Dape= ng Wang=C2=A0
--00000000000097dbd7064f19d683--