Suppose I have a table with a column name varchar(20), and I save a row with the name = "abcdef".
INSERT INTO tab(id, name) values(12, 'abcdef');
How is the memory allocation allocated for namein this case?
I can think of two ways:
and)
20 bytes are allocated, but only 6 is used. In this case, it varchar2does not have any significant advantages compared with charthe point of view of memory allocation.
b)
Only 6 bytes are allocated. If so, and after that I added a few more lines,
INSERT INTO tab(id, name) values(13, 'yyyy');
INSERT INTO tab(id, name) values(14, 'zzzz');
and then I do UPDATE,
UPDATE tab SET name = 'abcdefghijkl' WHERE id = 12;
6 , ?. , 6 ( 6, - ).
, ? ( ).