在我的Oracle数据库中,我有一个大小为3.44 GB的表。它是1784486行,450146,对应于8 kB块大小,每块平均4行,或每行2 kB。但AVG_ROW_LEN只有369个字节。是什么导致了这种差异?
更多详情:
PCT_FREE只有10个,所以不应该负责。压缩目前已关闭。表格布局是(列名称一般化)
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)
答案 0 :(得分:4)
行。让我们首先弄清楚TOAD在哪里得到你正在看的数字
什么是
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>>
返回表的大小?
什么是
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>>
返回表格的统计数据?
什么是
SELECT COUNT(*)
FROM <<owner of table>>.<<name of table>>
返回表中的实际行数?
什么是
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;
显示如何使用表中的块?
1月14日14:02:29后行是否更新了?特别是,是否有可能插入相对较小的行但随后更新为更大的行?如果您在表格上重新收集统计数据,是否会发生任何变化
BEGIN
dbms_stats.gather_table_stats( ownname => <<owner of table>>,
tabname => <<name of table>>,
estimate_percent => null,
granularity => 'ALL' );
END;