188: In your datawarehousing application, you generate reports frequently.
The data is static in the tables being used to generate reports. You are
currently using joins, resulting in a large performance overhead.
What kind of database structure would you use to reduce the response time
of the query?
A.hash clusters
B.index clusters
C.partitioned tables
D.indexorganized table (IOT)
Answer: B
Oracle 中普通的表称为堆表(heap table),堆表中的数据是无序存放的,
往往在使用一段时间后,数据就变得非常无序。索引中相同的key 对应的数据存
放在不同的block 中,这时,如果要通过索引查询某个key 的数据,就需要访问
很多不同的block,代价非常高。
hash cluster 简单的说就是通过预先分配空间的方式,将相同key 的数据存
放在一起,以提高查询性能的一种手段,所以准确的设置hashkeys 和size 参数
是使用hash cluster 的关键,使用的前提是key 的数量是可以估算的,而且每
个key 的数据是基本平均的。但是,在实际使用的环境中,数据量的变化往往是
不可预知的,这也造成hash cluster 的应用场景非常有限。
Index cluster 和hash cluster 类似,只不过index cluster 是通过索引实
现数据定位,而且index cluster 的空间是动态分配的,但是同样存在正确设置
size 参数的问题,设置过大过小都会产生性能问题。
cluster
性能優點
--DISK I/O 減少﹐表連接的提高存儲時間。
--所有相同行的每個cluster key 只存儲一次。
性能方面的考慮
--全表掃描時﹐cluster table 比無cluster 的表慢。
cluster 類型
--index cluster
--hash cluster
什么時候用何種cluster 比較
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/11312660/viewspace-718251/
,如需转载,请注明出处,否则将追究法律责任。