A hash day

In my plan, today should be used to write my research plans. However, I don’t know why, maybe just want to work out the problems encountered during programming. Maybe I just want to prove I can deal with these kinds of problems. But these really postponed all my plan. The homework, the research plan I promised to my supervisor, the papers, the assignments…

Before noon, I said to myself “Start to write your research plan, not do the programming work!”. After lunch, sit before the computer, I just want to work on the project. I don’t want those bugs live there for more than one minute. Just like this, several days ago I decided to stop, I did not.

However, till just now, I really finished most of the parts. It is the time to stop for other things.

From morning, I was working on passing data from Flex to Flash. I read a lot of articles about it and download several codes to try out. Finally, the using of LocalConnection method is the best one. I tried it in my application. Then failure. Once after once, I tried for nearly hundred times. All the same result – connection failed!

No progress except I found that the failure is not bi-direction, from flash to flex, it always works well. However, from flex to flash, I just encountered two times of successful connection! All the other attempts are  all failure!!!!

When I tried out the downloaded codes, it works well both directions. So I believe it must be feasible! The result is I keep on trying and more and more failures. Then more and more depressed. I nearly got mad about this. If there were no other people in the lab, I may have throw my computer away.

In the afternoon, my wife came online. She asked me to do other things to relax. But I don’t think I have time. So just go on. But I really got ruffled. So I go out and stay quiet thinking nothing. When come back, I really come up with some different solutions.

Maybe she is right. When you cannot go on. Just stop and relax, then you may find a new world!

HCP.HR_CARDING和FINGER5.FGT_FILE两表的数据量达几百万万,如下SQL超半小时也无法执行出结果,请协助优化SQL提高执行效率,并最后提供完整SQL:WITH FGT_FILTERED AS ( SELECT /*+ MATERIALIZE */ FGT10 AS BPM_ID, FGT02, TRUNC(FGT02) AS FGT_DAY, SUBSTR(FGT08,3,1) AS STATUS_RAW -- 预计算减少重复调用 FROM FINGER5.FGT_FILE WHERE SUBSTR(FGT08,3,1) IN ('1','2') ), A AS ( SELECT /*+ INDEX(A IDX_HRCARDING_BPM) */ A.PSN_ID, A.PSN_SEG_SEGMENT_NO, A.CDAY, A.INTIME, A.OUTTIME, A.DAYHOURS, A.SHIFT_ID, C.SHIFT_NAME, HCP.SF_BPM_ID_GET(A.PSN_ID,9) AS BPM_ID, CASE WHEN C.SHIFT_NAME LIKE '晚班%' -- 修改LIKE条件为左匹配 THEN A.CDAY + 1 + INTERVAL '12:00' HOUR TO MINUTE END AS NIGHT_SHIFT_END FROM HCP.HR_CARDING A INNER JOIN HR_SHIFT C ON A.SHIFT_ID = C.SHIFT_ID AND A.PSN_SEG_SEGMENT_NO = C.SEG_SEGMENT_NO WHERE EXISTS ( SELECT /*+ HASH_SJ */ 1 FROM FGT_FILTERED F WHERE F.BPM_ID = HCP.SF_BPM_ID_GET(A.PSN_ID,9) ) ), B AS ( SELECT STATUS_RAW AS STATUS, FGT02, BPM_ID, FGT_DAY, ROW_NUMBER() OVER ( PARTITION BY BPM_ID, FGT_DAY, CASE WHEN STATUS_RAW = '2' THEN SIGN(FGT02 - (FGT_DAY + 0.5)) END ORDER BY FGT02 DESC ) AS RN FROM FGT_FILTERED ) SELECT /*+ PARALLEL(4) */ A.PSN_ID, A.PSN_SEG_SEGMENT_NO, A.CDAY, A.INTIME, A.OUTTIME, A.DAYHOURS, A.SHIFT_ID, A.SHIFT_NAME, MAX(CASE WHEN B.STATUS = '1' THEN B.FGT02 END) AS INACTUAL, MAX(CASE WHEN B.STATUS = '2' THEN B.FGT02 END) AS OUTACTUAL FROM A LEFT JOIN B ON B.BPM_ID = A.BPM_ID AND B.RN = 1 AND ( (A.SHIFT_NAME LIKE '白班%' AND A.CDAY = B.FGT_DAY AND B.FGT02 BETWEEN A.INTIME AND A.OUTTIME) OR (A.SHIFT_NAME LIKE '晚班%' AND A.CDAY = B.FGT_DAY AND B.FGT02 BETWEEN A.CDAY AND A.NIGHT_SHIFT_END) ) GROUP BY A.PSN_ID,A.PSN_SEG_SEGMENT_NO,A.CDAY, A.INTIME,A.OUTTIME,A.DAYHOURS,A.SHIFT_ID,A.SHIFT_NAME;
03-21
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值