Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pprc5-0006Yl-G7 for pgsql-general@arkaria.postgresql.org; Fri, 21 Apr 2023 14:19:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pprc3-0004tu-8u for pgsql-general@arkaria.postgresql.org; Fri, 21 Apr 2023 14:19:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pprc2-0004tg-KC for pgsql-general@lists.postgresql.org; Fri, 21 Apr 2023 14:19:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pprc0-0015bf-8E for pgsql-general@postgresql.org; Fri, 21 Apr 2023 14:19:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 33LEJgrt3338046; Fri, 21 Apr 2023 10:19:42 -0400 From: Tom Lane To: Daniel Wu cc: pgsql-general@postgresql.org Subject: Re: HOT update: why must ALL indexes should be update? In-reply-to: References: Comments: In-reply-to Daniel Wu message dated "Fri, 21 Apr 2023 22:06:41 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3338044.1682086782.1@sss.pgh.pa.us> Date: Fri, 21 Apr 2023 10:19:42 -0400 Message-ID: <3338045.1682086782@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Daniel Wu writes: > We have many indexes on a table. The chance is that any column could be > some part of an index. I understand that when an index has a column that is > updated, we can't use HOT, because the index entry could point to a totally > different row. But if I have 10 indexes, if only 1 index will be updated, > why the rest 9 indexes couldn't use HOT update? Whether it's a HOT update is a property of the table row, not of individual indexes. regards, tom lane