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 1w58sg-002wJh-1y for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 21:01:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w58sf-008xO9-0J for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 21:01:41 +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 1w58se-008xNs-13 for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 21:01:41 +0000 Received: from fhigh-b1-smtp.messagingengine.com ([202.12.124.152]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w58sZ-00000000wcn-1NDP for pgsql-hackers@postgresql.org; Tue, 24 Mar 2026 21:01:38 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id B16AF7A0220; Tue, 24 Mar 2026 17:01:32 -0400 (EDT) Received: from phl-imap-14 ([10.202.2.87]) by phl-compute-02.internal (MEProxy); Tue, 24 Mar 2026 17:01:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burd.me; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1774386092; x=1774472492; bh=HeCwqQUSTgYo3VgaKBA9P2smr+EKJcvaYpNu504f9xA=; b= CCZw7vJ0TKD0BXl0Z1HUttbV8IH66pIoNqWK7lvO8pPw2DVTOJeii8XOMHajpsW7 HJ3ly7RS1zkFy9hn+e/zCJdXM2BV/hjBABsd+5QyxLGfspltRegZy51BXiI42m2M jUCGLWfZJP+YRPbwzg36rbHoeBAgEJBytrw91jHas4OfwB+YtWDIjDXTGHPVPHKp Jb7x1y3rm2L03eXSsbe/YGz7Ew0UUEWLAyhfeZ9sr/mvwsP+2/SHEF1BcuvlOtgW Q3zoo6aBkdiLAD4pfmMqDCMHIH0PX9stPZKmhnbQx/5eUoKqzEBuIbAuAttfgTpg 1Hvj5ExlKwfoBPgWC/N8YQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1774386092; x= 1774472492; bh=HeCwqQUSTgYo3VgaKBA9P2smr+EKJcvaYpNu504f9xA=; b=X 96TiK4KGtXtSSLyYvgTZPyXcOfcHYwkn0iBlKZrRiC4Fxkmj5LYLascK/zGq28pH Q1FifFrBv5EQvST2FfVZbwdV383CbrQ3odtiHV89u3DKsL/nXjt7lE9wGkq7LNAi k1neJD5kNNWllEfGLeJ4lal0b00zlWNulOWgPBjqqi8jLH/wRNAgEUHDsGcOPQUW apJdOQUdVlB8SRBrMZ6YUU+VWV3b7AGg04MJx11P6JbIgal+UcBYid2ljUTyIjzi UYRvjZQmVXU775AR9BTHfSCYWVW04nm/uOC2rR4Wzb7nh30a4mltPAXwjIZlGR+n 30tTFtchW3b14vDr+9nkg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvddviedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedfifhrvghg uceuuhhrugdfuceoghhrvghgsegsuhhrugdrmhgvqeenucggtffrrghtthgvrhhnpedvue fhffdtvdevueffteehheefleevtedvfedtueefffeijeefudelveeftdffudenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvghessghurh gurdhmvgdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthht ohepnhgrthhhrghnuggsohhsshgrrhhtsehgmhgrihhlrdgtohhmpdhrtghpthhtohepph hgshhqlhesjhdquggrvhhishdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgv rhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i675e48f3:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 451E3C4006E; Tue, 24 Mar 2026 17:01:32 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: Aqv5ICFmdMAN Date: Tue, 24 Mar 2026 17:01:12 -0400 From: "Greg Burd" To: "Nathan Bossart" Cc: "Jeff Davis" , pgsql-hackers Message-Id: <4040d3a4-01c2-4f24-9025-57cfc19aea57@app.fastmail.com> In-Reply-To: References: <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> <887b1ee62794553a95c3578fcdc0cc1831e68b27.camel@j-davis.com> Subject: Re: Expanding HOT updates for expression and partial indexes Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Mar 24, 2026, at 3:44 PM, Nathan Bossart wrote: > On Tue, Mar 24, 2026 at 02:02:07PM -0400, Greg Burd wrote: >> On Mon, Mar 23, 2026, at 2:39 PM, Nathan Bossart wrote: >>> On Tue, Mar 17, 2026 at 02:04:11PM -0400, Greg Burd wrote: >>>> - * INDEX_ATTR_BITMAP_SUMMARIZED Columns included in summarizing indexes >>>> + * INDEX_ATTR_BITMAP_INDEXED Columns referenced by indexes >>>> + * INDEX_ATTR_BITMAP_SUMMARIZED Columns only included in summarizing indexes >>> >>>> - Bitmapset *summarizedattrs; /* columns with summarizing indexes */ >>>> + Bitmapset *indexedattrs; /* columns referenced by indexes */ >>>> + Bitmapset *summarizedattrs; /* columns only in summarizing indexes */ >>> >>> As before, the comment changes for the summarized-attr-related stuff seem >>> unnecessary. >> >> I disagree, the "only" is required to highlight the logic change here. >> Before this patch summarized attrs could overlap with indexed attrs, now >> it should not. This makes the logic a bit easier later in >> HeapUpdateHotAllowable(). > > My bad, you are right. Hey Nathan, No worries, that's why we talk about it. :) >> So, we go from 3 calls to RelationGetIndexAttrBitmap() to 1, or at most 2 >> when there's a summarizing index (which is frequently the case). I meant to say that the common case (no summarizing indexes) we don't need more than the 1 bitmap, only in the less common case do we even need to get the *only* summarized attrs from relcache. >> This feels more logical, cleaner, and has less overhead but supports the >> same HOT logic. > > Nice. I'm happy that you agree! > -- > nathan best. -greg