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 1w2WFG-000MXI-2X for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Mar 2026 15:22:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2WFE-002ZHf-3A for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Mar 2026 15:22:08 +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 1w2WFE-002ZHX-2J for pgsql-hackers@lists.postgresql.org; Tue, 17 Mar 2026 15:22:08 +0000 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2WFC-00000000cm0-11G9 for pgsql-hackers@postgresql.org; Tue, 17 Mar 2026 15:22:08 +0000 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-7d75ed779bfso5723553a34.2 for ; Tue, 17 Mar 2026 08:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773760925; x=1774365725; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=zMgUma+1ZrvC8I1JcnOogn4v+TVAnVgr8ToQDRluTnU=; b=dzQX+q4X2OA1UW9PEA0OjhqXWABT6Xt6I6H/9JNOZ+kj7dIzuqJy+4XOcqV1XX44VB JErz2oRdrU5chgmFL0QXOLQqiooA6KqSTSpzJQM2koOgFKPelH/znWQrcndn0UC9E0fY iQhjjV6EUbWhc1M0qmHffZUbXbaip12oDwy01MMGi9CRoM4CDjUKTf3H6HPDVIhv/VC0 2jlnhfTtml1rAc9q3QpDcI2AocXXVySffANUUJBeHrYBu4e8b4thke0t/I+h2GhzvyFW 5UzLFYiaikwJLvr1gWnvL0Riypmabdli1PhixNjG4QaGFzsUt8jPLQIvBmZv5zgA21Vu 9B1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773760925; x=1774365725; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zMgUma+1ZrvC8I1JcnOogn4v+TVAnVgr8ToQDRluTnU=; b=FVksWJnKFMRlK9SXp3CMJ+H1A40OCQTsNkyEi1TC3vnTXmHI5KeM+cGdeCyT7ZuDZO qwCXIW4Vq06593kwu/AZ8xN7iKCBE37IPBeKiFBsip6B8yl5noTKFxAyp3JNSJs2Syk8 hicxAz5bxM4W/lGN3jPfBSGOqIrZIrpoQTlsAaweuRR/uNC9dg++wngXoncmF9OPMxx4 8DwFCvy62sKMlWn6H7nodPu2jdowjj3Xabx4WAVjc+QD+yNqkSUt3bZLY/v6iHPXkxFl 1nhA74IGwgNyklEP38HN5VLzqK5aDWb2BTlP5QVB13WROPoPx8jXS0MxEaqTjSuI54V1 vyxw== X-Forwarded-Encrypted: i=1; AJvYcCVV0RUVbnww/p0JSWtEBkoitidI/Mi4FKCZ1Ur+U3zBc4L6b0EDwjSoESyvoIVMs7Crl8OdLiT8+ow5l8gq@postgresql.org X-Gm-Message-State: AOJu0YzjLDnNXaNryKJ/gqmoAoOTWx6mdTWTdtqHUsER25nVRF+m40c4 u3esCemybLKFb5kCEGVPsdiGO3EGItsU+SYerHVCtMH6Ldc6HKbbetM+5DUOsA== X-Gm-Gg: ATEYQzwiDkll7JZ2JTS3S1nLGzfUBEryAEwkg83XWa6f8NgkSgZIVV2XEDIDbDM3e8T XQr35MmbMjQbWYZjgrXPI+06BlsBYuy55Byeu/4+9ojj22HnABJPFJpU12VIloetIkqbc/U6rC1 fPrrd1/0Hot/DVUmzS0GlqwgnWHTyJx6ser5crC/Diegk3aM3D5QmRX8RX/gxLCSC0DdURCePKH cqFHFdRkEun5LrmIEFF/iH6mLIrg42N0Hk2WUx0RXyRzDFA558Hb7ayXqUdIIEwhiwWC9WTCkpm GNykWv02igrZckZqZHV0ODaxuszrnYLvLFpMVgssf0dXDDe4rNplSOZw7EeZlr4Jbg4RTiHQdex ohir+iGIR3yFbRk/02sEIzfTZMAq8nY0+LP8TzQ1OzHxuoaqWFUVuW25eEPoyzL34/eJ1LFt3Ma +FK8U5uRSlcRGPxWAp0/J1FXoimwL1P39VR/VxOYFQ+P1p83ZcOBnm5R2Sl9YvtTJU+0outHFqv +LIK6wEp7IdiMXdlvbEUyL6wf4CBsTw X-Received: by 2002:a05:6830:6afb:b0:7d7:5fa3:7443 with SMTP id 46e09a7af769-7d78245bf32mr11845480a34.10.1773760924848; Tue, 17 Mar 2026 08:22:04 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7d77c961e79sm11562329a34.7.2026.03.17.08.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2026 08:22:04 -0700 (PDT) Date: Tue, 17 Mar 2026 10:22:02 -0500 From: Nathan Bossart To: Greg Burd Cc: Jeff Davis , pgsql-hackers Subject: Re: Expanding HOT updates for expression and partial indexes Message-ID: References: <872b875c-0aa4-4269-9c84-532227b32361@app.fastmail.com> <91f4dbe2-21ed-49f3-bebe-270f9bbec9d5@app.fastmail.com> <811d6f42e5481935943556b692859aae9146d4c9.camel@j-davis.com> <7b8681a578b5fe77103948eeb7b5cdd80fabad5d.camel@j-davis.com> <4f48f75d-4f2a-4240-b66d-597517796e02@app.fastmail.com> <3fba3f5671eddb221ba38f5a12acbe7cad27edf3.camel@j-davis.com> <427bfbda-c901-49e4-b725-8ddc41bec23d@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <427bfbda-c901-49e4-b725-8ddc41bec23d@app.fastmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Catching up here. I see that you dropped 0002. Can you explain why that's no longer needed? On Mon, Mar 16, 2026 at 04:51:31PM -0400, Greg Burd wrote: > Refactor executor update logic to determine which indexed columns have > actually changed during an UPDATE operation rather than leaving this up > to HeapDetermineColumnsInfo() in heap_update(). Finding this set of > attributes is not heap-specific, but more general to all table AMs and > having this information in the executor could inform other decisions > about when index inserts are required and when they are not regardless > of the table AM's MVCC implementation strategy. Nice, this is a crisp motivation statement. > Development of this feature exposed nondeterministic behavior in three > existing tests which have been adjusted to avoid inconsistent test > results due to tuple ordering during heap page scans. Logistically speaking, these could be nice to get out of the way early as a prerequisite patch so we can focus on the substance of this patch. The rest of my comments are from a relatively quick skim. Deeper review to follow... > + /* > + * Reduce the set under review to only the unmodified indexed replica > + * identity key attributes. idx_attrs is copied (by bms_difference()) > + * not modified here. > + */ > + attrs = bms_difference(idx_attrs, modified_idx_attrs); > + attrs = bms_int_members(attrs, rid_attrs); > + > + while ((attidx = bms_next_member(attrs, attidx)) >= 0) Could it be worth moving this loop (and some surrounding code) to a helper function? > - * Note: beyond this point, use oldtup not otid to refer to old tuple. > + * NOTE: beyond this point, use oldtup not otid to refer to old tuple. nitpick: Please remove unnecessary changes. > @@ -5269,10 +5269,10 @@ RelationGetIndexPredicate(Relation relation) > * in expressions (i.e., usable for FKs) > * INDEX_ATTR_BITMAP_PRIMARY_KEY Columns in the table's primary key > * (beware: even if PK is deferrable!) > + * INDEX_ATTR_BITMAP_SUMMARIZED Columns only included in summarizing indexes > * INDEX_ATTR_BITMAP_IDENTITY_KEY Columns in the table's replica identity > * index (empty if FULL) > - * INDEX_ATTR_BITMAP_HOT_BLOCKING Columns that block updates from being HOT > - * INDEX_ATTR_BITMAP_SUMMARIZED Columns included in summarizing indexes > + * INDEX_ATTR_BITMAP_INDEXED Columns referenced by indexes Is the meaning of INDEX_ATTR_BITMAP_SUMMARIZED changing in this patch? I see you moved it and dropped the "only". > - Bitmapset *summarizedattrs; /* columns with summarizing indexes */ > + Bitmapset *indexedattrs; /* columns referenced by indexes */ > + Bitmapset *summarizedattrs; /* columns only in summarizing indexes */ But you added an "only" here... -- nathan