I've seen some discussions about the topic on the list recently, but I would like to get more clear answers.

Given the table:

CREATE TABLE t1 (
        f1 text,
        f2 text,
        f3 text,
        PRIMARY KEY(f1, f2)
);

and assuming I will execute UPDATE of f3 multiple times (say, 1000) for the same key values k1, k2 and different values of 'newval':

UPDATE t1 SET f3=newval WHERE f1=k1 AND f2=k2;

How will the performance of selecting the current 'f3' value be affected?:

SELECT f3 FROM t1 WHERE f1=k2 AND f2=k2;

It looks like all the previous values are preserved until compaction, but does executing the SELECT reads all the values (O(n), n - number of updates) or only the current one (O(1)) ?


How the situation looks for Counter types?

Reply via email to