Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3i8h-0005OG-2R for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Feb 2020 15:16:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j3i8f-0007CC-Ue for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Feb 2020 15:16:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3i8e-0007By-Lg for pgsql-hackers@lists.postgresql.org; Mon, 17 Feb 2020 15:16:49 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j3i8b-0006uE-L2 for pgsql-hackers@postgresql.org; Mon, 17 Feb 2020 15:16:47 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 8AC8463A; Mon, 17 Feb 2020 10:16:43 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Mon, 17 Feb 2020 10:16:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=mchMUvgHoXX5iecmGqmh/b89UEstxMckdCQSZ47ei Xk=; b=Th9+GlECrms4+/xwVKg6/tE0WkLz6aDYT3kmTq4HRNiE7tRoaAsy3Ev2a n+pVxiiK7guBpzXwm2bVIeQ6hMCq7S3BHhhfjGCLw2fCtsTEauMVaWdtnteDILF3 UaWn7+9kzEoTwgeyXb2cwtan3WnHkDgTD0zz7W1gkPuo+f65B1WtMXqTee1GSiGF qI3TtZtLwqrti1uLTJ+BikCUOPdhPeqUX2DkhZ4QkArknbrg7+kgu1km7ojgUMSM B9KEbZFldT1i+fKltM29Da6pd4FFYSPv5L7MQ23EpHE5yA58IlKKwhdcqdsT+9P5 RgNwBLAO/0lmCpHdQEzoA4P+PjlIg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjeeigdejhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhfhokffffgggjggtgfesthekredttdefjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsedvnhguqh hurggurhgrnhhtrdgtohhmqeenucffohhmrghinhepvdhnughquhgrughrrghnthdrtgho mhenucfkphepleefrddvgedvrddvheehrdduuddvnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhhtsedv nhguqhhurggurhgrnhhtrdgtohhm X-ME-Proxy: Received: from april.pezone.net (p5df2ff70.dip0.t-ipconnect.de [93.242.255.112]) by mail.messagingengine.com (Postfix) with ESMTPA id 1DDE73280062; Mon, 17 Feb 2020 10:16:41 -0500 (EST) Subject: Re: Optimize update of tables with generated columns To: Pavel Stehule References: <65fb745d-4c1a-7582-d61b-1686d8c5c85d@2ndquadrant.com> Cc: pgsql-hackers From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Mon, 17 Feb 2020 16:16:40 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-02-13 16:16, Pavel Stehule wrote: > čt 13. 2. 2020 v 14:40 odesílatel Peter Eisentraut > > napsal: > > On 2019-12-21 07:47, Peter Eisentraut wrote: > > When updating a table row with generated columns, we only need to > > recompute those generated columns whose base columns have changed in > > this update and keep the rest unchanged.  This can result in a > > significant performance benefit (easy to reproduce for example with a > > tsvector column).  The required information was already kept in > > RangeTblEntry.extraUpdatedCols; we just have to make use of it. > > > > A small problem is that right now ExecSimpleRelationUpdate() does not > > populate extraUpdatedCols.  That needs fixing first. > > Here is an updated patch set that contains a fix for the issue above > (should be backpatched IMO) and the actual performance patch as before. > > > + 1 > > I tested check-world without problems, and changes of patch has sense > for me. committed, thanks -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services