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 1vvM2I-00FFU8-1g for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Feb 2026 21:03: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 1vvM2F-008Zfo-0a for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Feb 2026 21:03:07 +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 1vvM2E-008Zfg-2V for pgsql-hackers@lists.postgresql.org; Wed, 25 Feb 2026 21:03:06 +0000 Received: from mail-dl1-x122a.google.com ([2607:f8b0:4864:20::122a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vvM2B-00000001B5W-2Qnx for pgsql-hackers@postgresql.org; Wed, 25 Feb 2026 21:03:05 +0000 Received: by mail-dl1-x122a.google.com with SMTP id a92af1059eb24-12732e6a123so281452c88.1 for ; Wed, 25 Feb 2026 13:03:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1772053384; x=1772658184; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=6ZHE2t5lhWVFtAyPKMgb1SM7I/e+UqQ048a0npxVgzU=; b=gSxoBVnyQTUvjpYUl/y0yNp2DD79Wwab+PKWD6ehWzHaFOFt04mofaqmby/KM5oaRM 3ZX6HfshvMbo/7dBWEJVWSWezGJyKFBQUTMGddw1j0DYYwZBOPuyeAafMEoVgbnY4adA RVLZv607iPCPxAUdmzuxRplkeUImn6XMWxFJAn668tFFIlkLO5XZFHbopuVacFLEycAK inYWlZZmx6DCuV06BVXwLzVHm3j0g3oiptYJYwL2BH85+GISZsvbZGiMuIpkB0BA2i9K jgzzr+HesjS2TSMZbv6+cZXi99hUUC8PbqX5CKDQNRvtbrhSr7v511ICHUihAZ0lSxBk pmEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772053384; x=1772658184; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6ZHE2t5lhWVFtAyPKMgb1SM7I/e+UqQ048a0npxVgzU=; b=C9rv1EGnceb2vwNRI4aSSSBdL3urrhwU+9Re4aAtw3qlS5bK7fO3bmStQQHKSFh82P x2dhNoqhBlIDLyOIzN89yd6FoLKOWs3crYuSwSoHAxZi2b/qLz/J0+myNKpEowsH7V5r sW2HnOPZrP+LH1SGywUtE70eOui7RscayGGyxsGS/18DB63RgMIcNNuy/SpwpzH6x7QF FjLQgDqfalH8gSxv350WkGR152EE3P01SWGGS4inPQovC48MMnwaj4908CqTm9a6qnza uJiyF0Ynilja+ecfJ/L+0WoaMVLJJ+fFtj7++W0bAEXeCd8PBZdpTKXC3EfwO9iK+f1r bB8w== X-Forwarded-Encrypted: i=1; AJvYcCVzKNHblzHvV6qtao5bSCQygEnauMA8OFPum+D8JoKFRHrwiqZ3+/BjKmViwm6wkgvzEPm5YlXLfVDyEvwX@postgresql.org X-Gm-Message-State: AOJu0YyyTX5ceJ/HYK29Vxa5Ijn51JgG3CD83Nrq83dmcLP6Wg3JfrnD QLkiJavHBSbhgbzWEK4G/T6wk8zGRZV/MQdPRTGB2FTnGYtRN7cu26X0cAr4an9HxA== X-Gm-Gg: ATEYQzyLHMJppeULWTlaLCD+bK0nUU2k1m18GjzHJQ9NtcRi3Vs4Yff+OnILfWybxXL 3teRpzPJFeFNeDXzLWyyZBgowMkNybXs2+2AjVrVJzY4IVAQViL6XxFyJgJBIdtpGi81HJpwAUE JlkiAaMx+KVilasRDrHj6VKJcjrpsT3lrtlWtFbF94fa7HVz25KjyXMXCFhqhbq1K0dsEkciIFL MdCEoMRWCg/pMUI3VTCz/CURqMIhzYd22bq4XVJXlqPpQwvvTGOYm/vWjDJqBOB0R/9bcajXFOm xsXCZYs99rCzJH+y39vByK3tohGrWjq+PXCiml/n8ryLqBRk1M0k+4R4Fj0+vCa42ZHJ0U944Gm bOXNziIFjNRIaoKmQXSJgCnowHRAzEZ8uNo2Dhmh4zZ5z+953dZNfOL3VAof8pkzAYXdxPEbd5b Wz0Uq+TOYLExu6DtjXrsyk9kCzHcMqaTXqzQurumNt1hsrHExiOzs= X-Received: by 2002:a05:7022:2485:b0:11b:9386:a3ca with SMTP id a92af1059eb24-1276ad8c79fmr6966314c88.43.1772053383694; Wed, 25 Feb 2026 13:03:03 -0800 (PST) Received: from jeff-laptop.lan (c-24-7-19-3.hsd1.ca.comcast.net. [24.7.19.3]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2bdd1f23c0csm123204eec.22.2026.02.25.13.03.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Feb 2026 13:03:02 -0800 (PST) Message-ID: Subject: Re: Expanding HOT updates for expression and partial indexes From: Jeff Davis To: Greg Burd , pgsql-hackers Date: Wed, 25 Feb 2026 13:03:01 -0800 In-Reply-To: References: <5165C147-B476-4E3D-AAA9-11C0B966FC4D@greg.burd.me> <9394564A-5764-4DCA-8845-8AE102DE61DC@greg.burd.me> <97769442-2ed7-4fe0-a393-7e2b5ff7ff58@app.fastmail.com> <3e1b9075c92808a7356e79087ba51910e5db5a30.camel@j-davis.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1.1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2026-02-23 at 14:23 -0500, Greg Burd wrote: > Hello. >=20 > Attached is a new patch set that fixes a few issues identified in the > last set. >=20 > 0001 - creates a new way to identify the set of attributes both > modified by the update and referenced by one or more indexes on the > target relation being updated.=C2=A0 This patch keeps the > HeapDetermineColumnsInfo() path within heap_update() for calls from > simple_heap_update() when modified_attrs_valid is set to false.=C2=A0 I'm > not a huge fan of this, but it does serve as a way to illustrate a > minimal set of changes easing review a bit. >=20 > 0002 - splits out the top portion of heap_update() into both > heapam_tuple_update() and simple_heap_update(), adds a few helper > functions and tries to reduce repeated code.=C2=A0 The goal here was to > remove some of the mess related to the various bitmaps used to make > decisions during the update. IIUC, a minimal version of this patch set might be: * add 'mix_attrs' bitmap to API for table_tuple_update * have executor calculate the bitmap, using the old slot to see if expression results have changed * have simple_heap_update calculate the bitmap using heap_fetch to get the old tuple (would be a redundant pin, but not sure if that's a problem or not) And leave the rest mostly unchanged. Did I miss something? If not, it would be nice to see such a minimal patch and/or understand why we don't follow that approach. Regards, Jeff Davis