Обсуждение: Re: Performance of UPDATE operation

Поиск
Список
Период
Сортировка

Re: Performance of UPDATE operation

От
Jeff Janes
Дата:
On Mon, Feb 13, 2023 at 10:09 AM Mkrtchyan, Tigran <tigran.mkrtchyan@desy.de> wrote:

         0.524           0  BEGIN;
         0.819           0  INSERT INTO t_inodes (inumber, icrtime, igeneration)
         0.962           0  UPDATE t_inodes SET igeneration = igeneration + 1 where  inumber = :inumber;
         9.203           0  END;
```

My naive expectation will be that updating the newly inserted record should cost nothing

It takes less than 1/10 of the total time.  That is pretty close to nothing.  Why would you expect it to be truly free? 
 
... Are there ways
to make it less expensive?

Obviously here you could just insert the correct value in the first place and not do the update at all.

Cheers,

Jeff