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 1wBXJr-0019Ur-32 for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Apr 2026 12:20:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wBXJo-00GVzb-0Q for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Apr 2026 12:20:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wBXJn-00GVzT-2N for pgsql-hackers@lists.postgresql.org; Sat, 11 Apr 2026 12:20:08 +0000 Received: from mail-dy1-x1342.google.com ([2607:f8b0:4864:20::1342]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wBXJm-00000000Vp2-2Gs5 for pgsql-hackers@lists.postgresql.org; Sat, 11 Apr 2026 12:20:08 +0000 Received: by mail-dy1-x1342.google.com with SMTP id 5a478bee46e88-2ba9c484e5eso3224942eec.1 for ; Sat, 11 Apr 2026 05:20:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775910003; cv=none; d=google.com; s=arc-20240605; b=OEXSwuaRqgqrRNbXvXUj7CDt/IxIVInPc3gfDiZuGgHiyt1t4KxYKSi3M/D264Zlvm XJsGxVhzPZMNAn3EIz1ukm53AUKqplH1h4g82RT+uGkJcPDvRvqzLkAVShRd2hzzE70E R58JQoP4BneAFh8U2nA5E4vawrv/a7BmQT7nRNeLUuZTctBXGS7VMqg+7e5VBRCpFwAl vMO0TOVmr7s0goKIJ2a26en9Lmv3yUGAjWuxu7MIYEevgaQzDs5K5XI2qVxiIWfQd1wL dmBdYM81kDSd7tuOjbQevFoD0KWM0+U9GjS2EMgwdFG8duebhji9ajO8sk0eOLKhedBS Ly/g== 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=GKGrK+M/O3fxYeaAXO2bFK8EnvFH4qqQ2U7E9U1Ax1c=; fh=v5EgQa8wgq5Lar71dTvuTKNfxSVjfJRkBRg8IQEXPUo=; b=gK1GVqhoM264UaC2zljA6ry3MjJNrgKQPbyIiUoZa0WJrXFXgAHfwuFtClIQ0aNn7x LBuCqBdLs12uWmYNUTx1yqhgqhsGK57irVk7X5zzXQsrC2afaI5QeG57iA912SsQ0IRq f9Mgxas75jHKErz7i+kD71WeAQWbpqFIxGTC5aOUNUeq26f9JkxolZYTm86m8lMMv9JY 2Q6cSzwvZpXsKtDohJz8WWxmJPmSJLFa3Sx2e+7iP7yw7mB1w7teVO6p7WOIHiJgMYP7 JsFPHhAncdwGu8nGN4QJMou/6Zwq7m0V4Qya5zIYkq9WGwfLVEtKq6QYDAohrzDoJE2x +dXw==; 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=1775910003; x=1776514803; 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=GKGrK+M/O3fxYeaAXO2bFK8EnvFH4qqQ2U7E9U1Ax1c=; b=QfORnYmaESDM9Xg7UQGbBSW/To8Y4TbElt8YwbZWmt9hRw74Yv2c6pRrR7MJ+gygOR 0xah2RdwSRzvILfr40UgsOKupqrBflSPlNQe1O4ZltmmgP2BI+hFZXouH4dQ4InnWut1 imgqnbr5fk8FSFSNaYuY77gQNkzmHslLSX0hm8bS1iaEVNPVIjhuRvIG0PiOFbP4/ohQ jUmJxIxeZeZw76++LiSUM+z4LdpvyGDYQ3XefNCtSNxDwYh2YN/ck6X+0qX1PmtnQOxv FpWyhmlB2uKDhB/3EEIqk8vRrDSZtEDPT5AyuUX709qAf76N/H9e/c9SrLbzWt3hxkzM +mvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775910003; x=1776514803; 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=GKGrK+M/O3fxYeaAXO2bFK8EnvFH4qqQ2U7E9U1Ax1c=; b=h9jrgEaJnIqTA4fDruRzbBGLNh+c3t3ldMym2OPm/HqAPexxg0EgCZzUa0qoU0LHJt WVwv1A/JdaNuWDwTmzWp4PLpaoCSiikFBZ6mK+dw3m1LjvQtnSd51rBHezHXv8ABeAMw fXqiVcSrtjG3FXkLnZOtTUxPAuNlgL2jDUN/Qi+r2I/pI2FE5bgcI8CcAgxoIBgprsMf ceUcaz3dz7V61jGcHBn+KPt0STqDu2s4aT2p6eUKz3oNrRmHKUYSyXbD8msF2u5eRpPX y2U9qMR8A+nvaKksBCtn3reSxtX0QYySxMKBPLdlZeRzFBEVVhfcZtWglRiqmHFSiFVg KPcw== X-Gm-Message-State: AOJu0Yyi5PgpCwdz+hRS/l9oC/325vg/jRlFyzSlQfvmXpbilD8Elfx+ bURulhXKD91GDDSJUEH1xtlUgkLqxd4OhltrL9F5LxctCMD4HMFru8DomMHI6ulAlOxImHgGbFY uHGxPXRmkZ1YLhhwKic0tt29geTd9Bko= X-Gm-Gg: AeBDieuLJc1vp7bYwalA2hJKLJTVxMmkII/Xb11UpoEvgavcSJxGH0hp7mkdKw5Drmx iN+Gzb4UIrBTM4AX9yjH7sfCLoGlZv2zc6Cn3D1SWYNIxEOXIMGUdmWWfFVaIU35aeEtkv61ZwB jaCam0XDjXn1gKkqf+be9p8Ep3zGn2qHJN4zIn9h2au6k/ZSo9RoXW1BBxIkq9S1Mfk4P4AviBs FlWHWtl0DpDlXHDQIcaXus50skGsUlu8Or2orxIt2Ki8UcsLmSekf+qifNjFnJzM4z1WL4m9i+e xDEx73ZOuxKQIe+zQhTcXHmckarCYXD28oU9NkzC X-Received: by 2002:a05:693c:3114:b0:2c6:7f49:a871 with SMTP id 5a478bee46e88-2d58879fdfbmr4311830eec.20.1775910003460; Sat, 11 Apr 2026 05:20:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dapeng Wang Date: Sat, 11 Apr 2026 20:19:55 +0800 X-Gm-Features: AQROBzBlHIP4L5dxaWrOf57CzIDrly8QbY6zJWuRdsZeIvEsNY_K5hekLSDldIo 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="000000000000e8ce84064f2e4492" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e8ce84064f2e4492 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Lakshmi N =E4=BA=8E2026=E5=B9=B44=E6=9C=8811=E6=97= =A5=E5=91=A8=E5=85=AD 13:02=E5=86=99=E9=81=93=EF=BC=9A > Hi, > > On Fri, Apr 10, 2026 at 4:57=E2=80=AFAM Dapeng Wang > wrote: > >> 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? >> > > Updated the patch covering those two as well. > > > Regards, > Lakshmi > Hi Lakshmi, The updated patch now covers all four catalog scan loops. Applies cleanly, compiles without warnings, and all 247 regression tests pass. Regards, Dapeng Wang --000000000000e8ce84064f2e4492 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= =8811=E6=97=A5=E5=91=A8=E5=85=AD 13:02=E5=86=99=E9=81=93=EF=BC=9A
Hi,

On Fri, Apr 10, 20= 26 at 4:57=E2=80=AFAM Dapeng Wang <wangdp20191008@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">
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 noticed CFI is missing=C2=A0whil= e scanning pg_class for RELKIND_RELATION and RELKIND_TOASTVALUE. On a datab= ase with several thousands of tables, these scans can take a noticeable amo= unt of time. Attached a patch to address this.

Reg= ards,
Lakshmi
Hi Lakshmi,

The patc= h applies cleanly to HEAD and compiles without warnings.
make check pass= es (one unrelated ICU collation diff).

The two CHECK_FOR_INTERRUPTS(= ) additions in do_autovacuum() look
correct and are well-placed at the t= op of each loop iteration,
before any resources are acquired.

I n= oticed there are other similar catalog scan loops in
autovacuum.c that a= lso 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?

Updated= the patch covering those two as well.


<= div>Regards,
Lakshmi


Hi Lakshmi,

The updated patch now covers all four ca= talog scan loops.
Applies cleanly, compiles without warnings, and all 24= 7
regression tests pass.

Regards,
Dapeng Wang=C2=A0
=
--000000000000e8ce84064f2e4492--