索引组织表IOT(转)
索引组织表的数据按主键排序手段被存储在B-树索引中,除了存储主键列值外还存储非键列的值。普通索引只存储索引列,而索引组织表则存储表的所有列的值。索引组织表一般适应于静态表,且查询多以主键列。当表的大部分列当作主键列时,且表相对静态,比较适合创建索引组织表!(8i以上)[@more@]索引组织表的创建:CREATE TABLE docindex(token char(20),doc_id NUMBER,token_frequency NUMBER,token_offsets VARCHAR2(512),CONSTRAINT pk_docindex PRIMARY KEY (token, doc_id))ORGANIZATION INDEX TABLESPACE ind_tbs;必须给索引结构表指定
exists 和 in (转)
in适合内外表都很大的情况,exists适合外表结果集很小的情况.[@more@]exists 和 in =========================================================== 作者: xsb(http://xsb.itpub.net)发表于:2005.12.14 13:20分类: Oracle 出处:http://xsb.itpub.net/post/419/48395--------------------------------------------------------------- http://blog.itpub.net/category/385/14461 exists 和 in 使用一例 =========================================================== 今天市场报告有个sql及慢,运行需要20多分钟,如下:update p_container
statspack 必看的十项内容
http://xsb.itpub.net/post/419/38713statspack 必看的十项内容[@more@]、负载间档(Load profile)2、实例效率点击率(Instance efficiency hit ratios)3、首要的5个等待事件(Top 5 wait events)4、等待事件(Wait events)5、闩锁等待6、首要的SQL(Top sql)7、实例活动(Instance activity)8、文件I/O(File I/O)9、内存分配(Memory allocation)10、缓冲区等待(Buffer waits) 二、输出结果解释1、报表头信息数据库实例相关信息,包括数据库名称、ID、版本号及主机等信息 2、负载间档该部分提供每秒和每个事物的统计信息,是监控系统吞吐量和负载
一篇statspack分析例子
http://www.statspackanalyzer.com/sample.asp[@more@]You are not using your KEEP pool to cache frequently referenced tables and indexes. This may cause unnecessary I/O. When configured properly, the KEEP pool guarantees full caching of popular tables and indexes. Remember, an average buffer get is often 100 times faster than a disk read. Any table or index that consumes > 10% of the data buffer, or tables & indexes that have > 50% of their blocks residing in the data buffer should be cac
SQL优化编写规范
书写SQL语句一些较优化的方式[@more@] 1.书写格式 示例代码: 存储过程SQL文书写格式例 select c.dealerCode, round(sum(c.submitSubletAmountDLR + c.submitPartsAmountDLR + c.submitLaborAmountDLR) / count(*), 2) as avg, decode(null, 'x', 'xx', 'CNY') from ( select a.dealerCode, a.submitSubletAmountDLR, a.submitPartsAmountDLR, a.submitLaborAmountDLR from SRV_TWC_F a where (to_char(a.ORIGSUBMITTIME, 'yyyy/mm/dd') >= 'Date Range(start)' and to_char(