- 最后登录
- 2015-5-21
- 在线时间
- 100 小时
- 威望
- 0
- 金钱
- 345
- 注册时间
- 2012-12-19
- 阅读权限
- 10
- 帖子
- 99
- 精华
- 0
- 积分
- 0
- UID
- 824
|
1#
发表于 2013-3-5 14:57:03
|
查看: 4370 |
回复: 2
有一个查询- SELECT B.ROW_ID,
- B.INVENTORY_ITEM_ID,
- B.SEGMENT1,
- B.SEGMENT2,
- B.SEGMENT3,
- B.SEGMENT4,
- B.SEGMENT5,
- B.SEGMENT6,
- B.SEGMENT7,
- B.SEGMENT8,
- B.SEGMENT9,
- B.SEGMENT10,
- B.SEGMENT11,
- B.SEGMENT12,
- B.SEGMENT13,
- B.SEGMENT14,
- B.SEGMENT15,
- B.SEGMENT16,
- B.SEGMENT17,
- B.SEGMENT18,
- B.SEGMENT19,
- B.SEGMENT20,
- B.ATTRIBUTE1,
- B.ATTRIBUTE2,
- B.ATTRIBUTE3,
- B.ATTRIBUTE4,
- B.ATTRIBUTE5,
- B.ATTRIBUTE6,
- B.ATTRIBUTE7,
- B.ATTRIBUTE8,
- B.ATTRIBUTE9,
- B.ATTRIBUTE10,
- B.ATTRIBUTE11,
- B.ATTRIBUTE12,
- B.ATTRIBUTE13,
- B.ATTRIBUTE14,
- B.ATTRIBUTE15,
- B.GLOBAL_ATTRIBUTE_CATEGORY,
- B.GLOBAL_ATTRIBUTE1,
- B.GLOBAL_ATTRIBUTE2,
- B.GLOBAL_ATTRIBUTE3,
- B.GLOBAL_ATTRIBUTE4,
- B.GLOBAL_ATTRIBUTE5,
- B.GLOBAL_ATTRIBUTE6,
- B.GLOBAL_ATTRIBUTE7,
- B.GLOBAL_ATTRIBUTE8,
- B.GLOBAL_ATTRIBUTE9,
- B.GLOBAL_ATTRIBUTE10,
- B.PROGRAM_ID,
- B.PROGRAM_UPDATE_DATE,
- T.DESCRIPTION,
- T.LONG_DESCRIPTION,
- B.CONCATENATED_SEGMENTS,
- B.PADDED_CONCATENATED_SEGMENTS
- FROM MTL_SYSTEM_ITEMS_TL T, MTL_SYSTEM_ITEMS_B_KFV B
- WHERE B.INVENTORY_ITEM_ID = T.INVENTORY_ITEM_ID
- AND B.ORGANIZATION_ID = T.ORGANIZATION_ID
- AND T.LANGUAGE = userenv('LANG');
复制代码 查询结果时间很长,执行计划是两个表的全表扫描
其中t表约200万行数据,org_id中包含105.106.107.110(但由于dml较多所以无法使用位图索引),inventory_item_id返回基数较大,group by后约13万数据,language包含zhs,zht,us,ja(但同样无法使用位图是索引)查询中t.l=lang返回约50万行数据
问题是:我基于t表的DESCRIPTION,LONG_DESCRIPTION,org_id,inventory_item_id,language创建物化视图日志,完了创建on commit的快速刷新物化视图,要不要这样做,还是有其他方法也能提高本次查询?
olap的数据库
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Productio
NLSRTL Version 10.2.0.3.0 - Production |
|