Hi.

There is another similar case, what if update actually change nothing?

BEGIN;
INSERT INTO person(id, name) VALUES(1, 'ivan');
UPDATE person SET name = 'ivan' WHERE id = 1;
COMMIT;

Should it we take into account both operations or not?

I'd think current implementation is correct one as
TX will make only one update in both cases.


On Fri, Aug 17, 2018 at 4:54 PM Павлухин Иван <vololo...@gmail.com> wrote:

> Hi team,
>
> I need you opinion again. I wrote some tests for metrics and felt a
> confusion with metrics count for the same key update during transaction.
> Imagine following case:
>
> BEGIN;
> INSERT INTO person(id, name) VALUES(1, 'ivan');
> UPDATE person SET name = 'vanya' WHERE id = 1;
> COMMIT;
>
> My intuition said me that puts count should be increased by 2 for such
> case. But current (non-mvcc) implementation increments by 1. I am not sure
> that it is proper semantics. On the other hand, I think that it is better
> to preserve existing behavior instead of making exception for mvcc. It will
> cause even more confusion.
>
> So, if nobody has objections I will go with existing semantics.
>


-- 
Best regards,
Andrey V. Mashenkov

Reply via email to