0 like 0 dislike
104 views

Please log in or register to answer this question.

1 Answer

0 like 0 dislike
answered by (4k points)  
Greenplum does not update the records, it marks the delete flag.

Each record contains two slots, xmin and xmax.

Updating a row is treated as a delete and an insert, so the XID (transaction ID) is saved to the xmax of the current row and the xmin of the newly inserted row.

Now let us see how update works with help of an example;

Sample data:

[ROW id][xmin][xmax]

[R1][T1][0] —————-> First time record is inserted, R1

                                       Updating same records after sometime

[R1][T1][T22] ————-> Record R1 is updated; T22 is the new row transaction id

[R22][T22][0] ————-> New updated record R33; Note 0 in xmax indicates new record.

If the record is deleted simply xmax will have the XID.

Related questions

...