Does the delete+insert is fater and less cpu consumer than update?

From: hmidi slim <hmidi(dot)slim2(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Does the delete+insert is fater and less cpu consumer than update?
Date: 2017-12-14 22:08:30
Message-ID: CAMsqVxtkRvvZ5UF0X3AXfr3gYA54keSk6T7AhZoHsguoMn_2rQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
I have a table named 'establishment' which has a join with a table
'category' and a table 'product'. I added indexes to foreign keys to
enhance the execution time of the update or delete of data.
I have to update the table establishment when I get a new data received
from an external api. The amount of updated data is about 3000-5000 rows.
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.
I didn't make any test for the performance between them and I want first of
all to know if the update consumes more cpu in case of a large amount of
data and with table with join.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2017-12-14 22:32:56 Re: Does the delete+insert is fater and less cpu consumer than update?
Previous Message Peter Devoy 2017-12-14 21:21:42 User-defined print format for extension-defined types in psql output