- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
managetable精要
Objectives Storing User Data Regular tables Partitioned tables Index-organized tables Clustered tables 普通表 分区表 : 如果一个表太大了,那么就会在这个大表的基础上,在分为子表,叫做 partition. 每个 row 是存储在一起的,比如 有1000行数据,可能 前 500 rows 存储在一个 partition 里边,后 500 rows 存储在一个 partition里。每个分区是一个 segment, 并且可以存储在不同的tablespace中。 Index-organized tables : 这个“索引表” 不同于以往意义的索引,它是将存储的数据本身按照某种顺序进行了存储,所以查询效率很高。with a primary key index on one or more of its columns. an index-organized table maintains a single B- tree containing the primary key of the table and other column values. 集群 : Clustered tables , 很多表是有相关性的,比如 Join 多个表,那么,可以将多个表存储为集群,这样在查询时会提高效率。 Clusters have a cluster key, which is used to identify the rows that need to be stored together. cluster key can consist of one or more columns. Tables in a cluster have columns that correspond to the cluster key. The cluster key is independent of the primary key. Data Type 99% 用的是 built-in 类型, 99% 使用 Scalar 数字型,文本型,日期型,二进制( LOB ) 尽量用 varchar2 , 不要使用 char,? 除非是固定格式,比如性别,只有 男,女 如果 oracle 内部表的列数超过 254列,oracle 会将一行 分成几块来存储。会加重 I/O 负荷。 索引是依附于表的。 对于任何一张表都有 ROWID,隐含的。 select ROWID, ID, NAME from employee; ROWID 的内容, 可以看到 ROWID 可以快速定位一条记录的位置。 Table Structure 90% 一行放在一个 database block 中。( 一个 database block 中还可以放行 ) 列存储的顺序通常就是你定义的列的顺序,并且如果某列的值是 NULL, 那么是不会存储该列的。 Row data is stored in database blocks as variable-length records.?columns for a row are generally stored in the order in which they are defined and any trailing NULL are not stored. Note: A single byte for column length is required for non trailing NULL columns. Each row in a table may have a different number of columns. Each row in a table has : row header : 这行有多少列,还有链接信息,还有锁的情况。row lock row data : 存储列的长度,还有列的值。列的值是紧挨着列的长度信息。 for each column, the oracle server stores the column length and value ( one byte is needed to store the column length if the column cannot exceed 250 bytes. A column that can be longer needs three length bytes. The column value is stored immediately following the column length bytes.) CREATE TABLE 该命
文档评论(0)