- 最后登录
- 2015-5-21
- 在线时间
- 100 小时
- 威望
- 0
- 金钱
- 345
- 注册时间
- 2012-12-19
- 阅读权限
- 10
- 帖子
- 99
- 精华
- 0
- 积分
- 0
- UID
- 824
|
1#
发表于 2013-1-30 10:04:09
|
查看: 4363 |
回复: 9
数据库10.2.0.3.0 olap
两种表mtl_material_transactions mmt(约150列,485万行数据),mtl_transaction_lot_numbers mtln(约150列,150万行数据)
一条select中只包含了两张表的外连接来获取所需信息- select mmt.organization_id,
- mmt.primary_quantity,
- nvl(mtln.transaction_quantity, mmt.primary_quantity) transaction_quantity,
- mmt.TRANSACTION_ACTION_ID,
- mmt.INVENTORY_ITEM_ID,
- mmt.transaction_type_id,
- mtln.lot_number,
- mmt.transaction_id
- from mtl_material_transactions mmt, mtl_transaction_lot_numbers mtln
- where mmt.transaction_id = mtln.transaction_id(+)
- and mmt.organization_id = mtln.organization_id(+)
复制代码 备注信息:- select organization_id
- from mtl_material_transactions
- group by organization_id
复制代码 organization_id
1 137
2 105
3 106
4 107
1 137
2 105
3 106
4 107- select organization_id
- from mtl_transaction_lot_numbers
- group by organization_id
复制代码 organization_id
1 106
2 107
两张表transaction_id 包含不同值信息较多,两张表上transaction_id 列和organization_id有复合索引无其他索引
问题:对于这样一条语句,是该拆表,还是改分区表(根据organization_id)还是在organization_id列上添加位图索引 |
|