mardi 3 mars 2015

Why does Oracle indicate my table is using so little space?


I'm running Oracle 11g. I have a table with two BLOB columns. I inserted 10,000 rows into the table, and each column contained a byte array of size 10289.


As you can see, there are 10,000 rows in the table and each column has 10,289 bytes in it:



SQL> select count(*) from MYUSER.MYTABLE;

COUNT(*)
----------
10000

SQL> select min(length(COL1)), min(length(COL2)) from MYUSER.MYTABLE;

MIN(LENGTH(COL1)) MIN(LENGTH(COL2))
----------------- -----------------
10289 10289


Therefore the table should be using up at least 205MB of space (10289 bytes * 2 * 10000).


But I used the query given here to find out how much space the table is using, and I got the following:



SQL> SELECT SUM(bytes), SUM(bytes)/1024/1024 MB FROM dba_extents WHERE owner = 'MYUSER' AND segment_name = 'MYTABLE';

SUM(BYTES) MB
---------- ----------
2097152 2


Why does it say the table is using up just 2 MB when it should be using up 250 MB?


The byte arrays I'm inserting are compressed data, so Oracle couldn't possibly be compressing that data any further.





Aucun commentaire:

Enregistrer un commentaire