关于并行度问题请教,谢谢!

[复制链接]
查看11 | 回复4 | 2014-7-11 07:56:59 | 显示全部楼层 |阅读模式
我查询如下语句,发现有报错,具体见:
SQL> select '0|20604|'||out_file_name||'|'||FILE_COUNTS||'|'||NUM_01||'|'||DURATIONS||'|'||SETT_FEES||'|'||START_DATETIME
2 from test
3 wheremodel_code=32and log_type=42 and out_file_name like '%SettlementSta%'
4 and substr(START_DATETIME,1,8) =to_char(sysdate-1,'yyyymmdd');
select '0|20604|'||out_file_name||'|'||FILE_COUNTS||'|'||NUM_01||'|'||DURATIONS||'|'||SETT_FEES||'|'||START_DATETIME
from test
wheremodel_code=32and log_type=42 and out_file_name like '%SettlementSta%'
and substr(START_DATETIME,1,8) =to_char(sysdate-1,'yyyymmdd')
ORA-12801: error signaled in parallel query server P003
ORA-01722: invalid number
发现model_code的类型为varchar型,并且tg_log 表为nologging, 并且该表有并行度,degree=4
发现奇怪的是,将32改为'32'后,也不报parallel的错误了。
SQL>
SQL> select '0|20604|'||out_file_name||'|'||FILE_COUNTS||'|'||NUM_01||'|'||DURATIONS||'|'||SETT_FEES||'|'||START_DATETIME
2from test
3 wheremodel_code='32'and log_type=42 and out_file_name like '%SettlementSta%'
4 and substr(START_DATETIME,1,8) =to_char(sysdate-1,'yyyymmdd');
'0|20604|'||OUT_FILE_NAME||'|'
--------------------------------------------------------------------------------
0|20604|SettlementSta.20090212.0001.951||1130950|114613471|53125.14|200902120030
0|20604|SettlementSta.20090212.0002.951||1716347|168510691|59825.08|200902121230
接着把test表的并行度和nologging都去掉,发现32不要改为'32'也能查出记录了,不报错了,这是为什么呢?
SQL> alter table test logging;
Table altered
SQL> alter table test noparallel;
Table altered
SQL>
SQL>
SQL> select '0|20604|'||out_file_name||'|'||FILE_COUNTS||'|'||NUM_01||'|'||DURATIONS||'|'||SETT_FEES||'|'||START_DATETIME
2from test
3 wheremodel_code=32and log_type=42 and out_file_name like '%SettlementSta%'
4 and substr(START_DATETIME,1,8) =to_char(sysdate-1,'yyyymmdd');
'0|20604|'||OUT_FILE_NAME||'|'
--------------------------------------------------------------------------------
0|20604|SettlementSta.20090212.0001.951||1130950|114613471|53125.14|200902120030
0|20604|SettlementSta.20090212.0002.951||1716347|168510691|59825.08|200902121230
[ 本帖最后由 wabjtam123 于 2009-2-13 16:08 编辑 ]
回复

使用道具 举报

千问 | 2014-7-11 07:56:59 | 显示全部楼层
这个问题应该很值得探讨,不顶起来不行啊

create table test_parallel (id1 varchar2(10),id2 number,id3 varchar2(20)) parallel 4 nologging;
insert into test_parallel values (1,2,3);
insert into test_parallel values (2,2,3);
commit;
insert into test_parallel values (8,2,3);
insert into test_parallel values (9,2,3);
然后不提交

select * from test_parallel where id1=2; 居然也不会报任何错啊?
我现在想构造例子,居然构造不出来????
[ 本帖最后由 wabjtam123 于 2009-2-13 17:16 编辑 ]
回复

使用道具 举报

千问 | 2014-7-11 07:56:59 | 显示全部楼层
再顶一下,希望引起高手的注意,我回忆不起来了这个东西......
回复

使用道具 举报

千问 | 2014-7-11 07:56:59 | 显示全部楼层
model_code列建的有索引吗?
回复

使用道具 举报

千问 | 2014-7-11 07:56:59 | 显示全部楼层
扫把兄弟,没有索引,只有在start_dateime列有一个函数索引
create index test (SUBSTR(START_DATETIME,1,8));
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行