Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePc3r-0007VY-J6 for pgsql-general@arkaria.postgresql.org; Thu, 14 Dec 2017 22:33:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePc3q-0001eL-LX for pgsql-general@arkaria.postgresql.org; Thu, 14 Dec 2017 22:33:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ePc3q-0001e6-Dl for pgsql-general@lists.postgresql.org; Thu, 14 Dec 2017 22:33:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ePc3n-0007yH-Jv for pgsql-general@postgresql.org; Thu, 14 Dec 2017 22:33:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id vBEMWuQQ025847; Thu, 14 Dec 2017 17:32:56 -0500 From: Tom Lane To: hmidi slim cc: pgsql-general@postgresql.org Subject: Re: Does the delete+insert is fater and less cpu consumer than update? In-reply-to: References: Comments: In-reply-to hmidi slim message dated "Thu, 14 Dec 2017 23:08:30 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25845.1513290776.1@sss.pgh.pa.us> Date: Thu, 14 Dec 2017 17:32:56 -0500 Message-ID: <25846.1513290776@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk hmidi slim writes: > I used an update query to update the modified rows, however when I search > on the net I found that some people said that update is cpu intensive > consumer and delete+insert is faster. It's possible that there are RDBMSes somewhere for which that is true. But as far as Postgres is concerned, it's nonsense. regards, tom lane