4 ms·
Unrelated question, about updating rows: when I insert rows into a table that has e.g. 30 varchar columns which are initially empty but which will be updated l
by zepearl 4y ago
Unrelated question, about updating rows:
when I insert rows into a table that has e.g. 30 varchar columns which are initially empty but which will be updated later (not all at once but e.g. 10 in a first round, then another 10 in another cycle, then the last 10), is it ok to leave those columns empty or should I e.g. use space-chars to fill those columns with the expected future length of the string?
Asking because I'm not sure if having the columns contents increase their size will cause kind of "row movement" (row cannot be updated in-place as there is no space to accomodate the new long string) which might(?) entangle a bit the contents of the table (e.g. maybe later the more rows are updated the more fragmented the table/tablespace becomes etc...).
I guess that Vacuum would fix such situations (if this actually happens), but maybe I can decrease the work that it has to do... . I'm just starting with Postgres, thx for reading.
EDIT: forget this, I just read here the post by "singron" stating "An update in postgres will always copy the tuple for MVCC, so it can't take advantage of an optimization like this to modify it in place", so the row gets moved anyway.