Why is my table size almost 10 times larger than expected from avg_row_len?

In my Oracle database, I have a 3.44 GB table. These are 1784486 lines and 450146, which corresponds to a block size of 8 KB and an average of 4 lines per block, or 2 KB per line. But AVG_ROW_LEN is only 369 bytes. What causes the discrepancy?

More details:

PCT_FREE is only 10, so it should not respond. Compression is currently disabled. Table layout (generic column names)

KEY NUMBER(38) NOT NULL, DATE1 DATE NOT NULL, DATE2 DATE NOT NULL, POINT NUMBER(4) NOT NULL, NAME VARCHAR2(200 BYTE) NOT NULL, BLOB_SIZE NUMBER(38) NOT NULL, BLOB_TYPE VARCHAR2(8 BYTE) NOT NULL, BLOB_FILTERS VARCHAR2(64 BYTE) NOT NULL, BLOB_DATA BLOB NOT NULL, PRECOMPUTED RAW(2000) -- currently no more than ~200 bytes -- (15 doubles, plus some headers) 
+4
source share
1 answer

OK Let me start by figuring out where the TOAD gets the numbers you look at.

What is he doing

 SELECT sum(bytes)/1024/1024/1024 size_in_gb, sum(blocks) size_in_blocks FROM dba_segments WHERE owner = <<owner of table>> AND segment_name = <<name of table>> 

return table size?

What is he doing

 SELECT num_rows, blocks, empty_blocks, avg_row_len, last_analyzed FROM all_tables WHERE owner = <<owner of table>> AND table_name = <<name of table>> 

back for statistics in a table?

What is he doing

 SELECT COUNT(*) FROM <<owner of table>>.<<name of table>> 

to return the actual number of rows in a table?

What is he doing

 DECLARE l_unformatted_blocks number; l_unformatted_bytes number; l_fs1_blocks number; l_fs1_bytes number; l_fs2_blocks number; l_fs2_bytes number; l_fs3_blocks number; l_fs3_bytes number; l_fs4_blocks number; l_fs4_bytes number; l_full_blocks number; l_full_bytes number; BEGIN dbms_space.space_usage (<<table owner>>, <<table name>>, 'TABLE', l_unformatted_blocks, l_unformatted_bytes, l_fs1_blocks, l_fs1_bytes, l_fs2_blocks, l_fs2_bytes, l_fs3_blocks, l_fs3_bytes, l_fs4_blocks, l_fs4_bytes, l_full_blocks, l_full_bytes); dbms_output.put_line('Unformatted Blocks = '||l_unformatted_blocks); dbms_output.put_line('FS1 Blocks = '||l_fs1_blocks); dbms_output.put_line('FS2 Blocks = '||l_fs2_blocks); dbms_output.put_line('FS3 Blocks = '||l_fs3_blocks); dbms_output.put_line('FS4 Blocks = '||l_fs4_blocks); dbms_output.put_line('Full Blocks = '||l_full_blocks); END; 

show how blocks are used in a table?

Were the lines updated after January 14 at 14:02:29? In particular, is it possible that several rows were inserted that were relatively small but then updated to be much larger in size? Something changes if you re-compile statistics in a table

 BEGIN dbms_stats.gather_table_stats( ownname => <<owner of table>>, tabname => <<name of table>>, estimate_percent => null, granularity => 'ALL' ); END; 
+4
source

Source: https://habr.com/ru/post/1399438/


All Articles