摘要: 查看数据库中有无多余的索引,即一个索引的字段为另一个索引的前几个字段。如index1的定义为test(filed1,filed2),index2的定义为test(filed1,filed2,filed3),则认为index1是多余的。(摘自Ixora) column redundant_index format a39column sufficient_index format a39select /*+ ordered */ o1.name||'.'||n1.name redundant_index, o2.name||'.'||n2.name suffici 阅读全文
posted @ 2008-05-21 17:14 dainiao01 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 通过bulk collect减少loop处理的开销采用bulk collect可以将查询结果一次性地加载到collections中。而不是通过cursor一条一条地处理。可以在select into,fetch into,returning into语句使用bulk collect。注意在使用bulk collect时,所有的into变量都必须是collections.举几个简单的例子:--在select into语句中使用bulk collectDECLARETYPE SalList IS TABLE OF emp.sal%TYPE;sals SalList;BEGIN-- Limit th 阅读全文
posted @ 2008-05-21 17:12 dainiao01 阅读(308) 评论(0) 推荐(0) 编辑