<p class="MsoNormal" style=""><span style="" lang="EN-US"><span style=""><span style="font-family: Times New Roman;"><span style="font-size: small;">1.</span><span style='font: 7pt "Times New Roman";'> </span></span></span></span><span style=""><span style="font-size: small;">索引表介绍:</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt;"><span style="font-size: small;"><span style="">对于普通表而言,其数据以无序方式存储;对于索引表来说,其数据以</span><span lang="EN-US"><span style="font-family: Times New Roman;">B-</span></span><span style="">树结构来组织,并且其叶块既包含健列数据,也包含非健列数据。对于普通表,表及其索引数据分别存放在表段和索引段中。当在</span><span lang="EN-US"><span style="font-family: Times New Roman;">WHERE</span></span><span style="">字句中引用索引列时,首先定位索引数据并取得</span><span lang="EN-US"><span style="font-family: Times New Roman;">ROWID</span></span><span style="">,然后根据</span><span lang="EN-US"><span style="font-family: Times New Roman;">ROWID</span></span><span style="">取得表的数据。</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt;"><span style="font-size: small;"><span style="">如果经常基于主键列检索表数据,</span><span lang="EN-US"><span style="font-family: Times New Roman;">ORACLE</span></span><span style="">建议使用索引表。对于索引表,</span><span lang="EN-US"><span style="font-family: Times New Roman;">ORACLE</span></span><span style="">会将表及其主键索引的数据一起存放在索引段中。当使用</span><span lang="EN-US"><span style="font-family: Times New Roman;">WHERE</span></span><span style="">字句中引用主键列时,</span><span lang="EN-US"><span style="font-family: Times New Roman;">ORACLE</span></span><span style="">可以直接根据主键索引值取得表行数据。</span></span></p>
<p class="MsoNormal" style=""><span style="" lang="EN-US"><span style=""><span style="font-family: Times New Roman;"><span style="font-size: small;">2.</span><span style='font: 7pt "Times New Roman";'> </span></span></span></span><span style=""><span style="font-size: small;">外部表介绍</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt;"><span style="font-size: small;"><span style="">外部表是指表结构被存放在数据字典,而表结构被存放在</span><span lang="EN-US"><span style="font-family: Times New Roman;">OS</span></span><span style="">文件中的表。通过使用外部表,不仅可以在数据库中查询</span><span lang="EN-US"><span style="font-family: Times New Roman;">OS</span></span><span style="">文件中的数据,还可以使用</span><span lang="EN-US"><span style="font-family: Times New Roman;">INSERT</span></span><span style="">方式将</span><span lang="EN-US"><span style="font-family: Times New Roman;">OS</span></span><span style="">文件装载到数据库中。在外部表上不能执行</span><span lang="EN-US"><span style="font-family: Times New Roman;">DML</span></span><span style="">修改,也不能建立索引。</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt;"><span style="font-size: small;"><span style="">对于普通表而言,其数据以无序方式存储;对于索引表来说,其数据以</span><span lang="EN-US"><span style="font-family: Times New Roman;">B-</span></span><span style="">树结构来组织,并且其叶块既包含健列数据,也包含非健列数据。对于普通表,表及其索引数据分别存放在表段和索引段中。当在</span><span lang="EN-US"><span style="font-family: Times New Roman;">WHERE</span></span><span style="">字句中引用索引列时,首先定位索引数据并取得</span><span lang="EN-US"><span style="font-family: Times New Roman;">ROWID</span></span><span style="">,然后根据</span><span lang="EN-US"><span style="font-family: Times New Roman;">ROWID</span></span><span style="">取得表的数据。</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt;"><span style="font-size: small;"><span style="">如果经常基于主键列检索表数据,</span><span lang="EN-US"><span style="font-family: Times New Roman;">ORACLE</span></span><span style="">建议使用索引表。对于索引表,</span><span lang="EN-US"><span style="font-family: Times New Roman;">ORACLE</span></span><span style="">会将表及其主键索引的数据一起存放在索引段中。当使用</span><span lang="EN-US"><span style="font-family: Times New Roman;">WHERE</span></span><span style="">字句中引用主键列时,</span><span lang="EN-US"><span style="font-family: Times New Roman;">ORACLE</span></span><span style="">可以直接根据主键索引值取得表行数据。</span></span></p>
<p class="MsoNormal" style=""><span style="" lang="EN-US"><span style=""><span style="font-family: Times New Roman;"><span style="font-size: small;">2.</span><span style='font: 7pt "Times New Roman";'> </span></span></span></span><span style=""><span style="font-size: small;">外部表介绍</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt;"><span style="font-size: small;"><span style="">外部表是指表结构被存放在数据字典,而表结构被存放在</span><span lang="EN-US"><span style="font-family: Times New Roman;">OS</span></span><span style="">文件中的表。通过使用外部表,不仅可以在数据库中查询</span><span lang="EN-US"><span style="font-family: Times New Roman;">OS</span></span><span style="">文件中的数据,还可以使用</span><span lang="EN-US"><span style="font-family: Times New Roman;">INSERT</span></span><span style="">方式将</span><span lang="EN-US"><span style="font-family: Times New Roman;">OS</span></span><span style="">文件装载到数据库中。在外部表上不能执行</span><span lang="EN-US"><span style="font-family: Times New Roman;">DML</span></span><span style="">修改,也不能建立索引。</span></span></p>