Hariharan Senthil pandiyan, January 12, 2017 - 4:47 pm UTC
Thanks for your Update Will check .
Some
Alex, April 11, 2018 - 2:15 pm UTC
How would you measure that this query
select rownum x, lpad('x', 4000, 'x') y
from dual connect by level <= 300;
returns slightly over 2MB of data?
My ORCL database is NLS_LENGTHT_SEMANTICS=Byte and NLS_CHARACTERSET AL32UTF8.
There are 300 records here from the above query, 2 columns.
When I run:
select x, vsize(x), dump(x), y, vsize(y), dump(y)
from t
order by x;
I conclude then, I have from the second, y, column 300 records*4000 bytes = 1 200 000 bytes.
From the first column, x, which is a number, I have 101 records*2 bytes + 199 records * 3 bytes.
That gives me 1.145MB. Where is my mistake?
April 11, 2018 - 4:30 pm UTC
Remember there are various overheads: each block has its own header + table and row directory. Then there's the row header too. And the default pctfree reserves 10% of the space in each block for future growth.
And in this instance, each row is nearly half a block. So by the time you add in these overheads, you only get one row in each block.
Also *segments reports the allocated space. Some of this may be unused.