本文介绍了是否有任何逻辑上的原因为索引具有不同的表空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好有些人可以告诉我为什么我们为索引和数据创建了不同的表空间。

Hi Can some let me know why we created different table space for Index and data.

推荐答案

这是一种普遍的看法将索引和表保存在单独的表空间中可以提高性能。现在许多尊敬的专家认为这是一个神话(参见),但仍然是一种常见做法,因为旧习惯很难过!

It is a widespread belief that keeping indexes and tables in separate tablespaces improves performance. This is now considered a myth by many respectable experts (see this Ask Tom thread - search for "myth"), but is still a common practice because old habits die hard!

从asktom中提取:从2001年开始用于Oracle版本8.1.6问题

Extract from asktom: "Index Tablespace" from 2001 for Oracle version 8.1.6 the question


  • 将索引保存在自己的表空间中仍然是个好主意吗?

  • 这会提高性能还是更多的恢复问题?

  • 答案是否因平台而异?

回复的第一部分

Yes, no, maybe.

The idea, born in the 1980s when systems were tiny and user counts were in the single 
digits, was that you separated indexes from data into separate tablespaces on different 
disks.

In that fashion, you positioned the head of the disk in the index tablespace and the head 
of the disk in the data tablespace and that would be better then seeking 2 times on the 
same disk.

Drives back then were really slow at seeking and typically measured in the 10's to 100's 
of megabytes (if you were lucky)


Today, with logical volumes, raid, NN gigabyte (nn is rapidly becoming NNN gigabytes) 
drives, hundreds/thousands of concurrent users, thousands of tables, 10's of thousands of 
indexes - this sort of "optimization" is sort of impossible.

What you strive for today is to be able to manage things, to spread IO out evenly 
avoiding hot spots.

Since I believe all things should be in locally managed tablespaces with UNIFORM extent 
sizes, I would say that yes, indexes would be in a different tablespace from the data but 
only because they are a different SIZE then the data.  My table with 50 columns and an 
average row size of 4k might belong in a tablespace that has 5meg extents whereas the 
index on a single number column might belong in a tablespace with 512k or 1m extents.

I tend to keep my indexes separate from the data but for the above sizing reason.  The 
tablespaces frequently end up on the same exact mount points.  You strive for even io 
across your disks and you may end up with indexes and data on the same devices. 

这篇关于是否有任何逻辑上的原因为索引具有不同的表空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 00:26