由于我使用循环语句从一张表里读取数据更新另一张表, 发现总会有其中某一个循环运行时间特别长.
排除服务器上有其他程序启动抢占资源, 因为我确认这时候只有这一个程序在运行.
下面是正常日志和时间长的日志对比, 发现page faults , page reclaims, Involuntary Context Switches 这三个后者显著要高, 有人知道是什么导致的吗, 如何解决?
1. 正常的日志:
MPRINT(AA): data temp.ti_asc_pt_stock;
MPRINT(AA): set temp.tm_ASC_PT_STOCK(firstobs=9300032 obs=9600032);
MPRINT(AA): modify temp.ti_asc_pt_stock key=idx3;
MPRINT(AA): if _iorc_ ne 0 then do;
MPRINT(AA): output;
MPRINT(AA): _error_=0;
MPRINT(AA): end;
MPRINT(AA): run;
NOTE: There were 300001 observations read from the data set TEMP.TM_ASC_PT_STOCK.
NOTE: The data set TEMP.TI_ASC_PT_STOCK has been updated. There were 0 observations rewritten, 300001 observations added and 0
observations deleted.
NOTE: DATA statement used (Total process time):
real time 42.46 seconds
user cpu time 4.09 seconds
system cpu time 16.80 seconds
memory 835.78k
OS Memory 5412.00k
Timestamp 2013- 9- 5 上午03时21分42秒
Page Faults 47
Page Reclaims 147
Page Swaps 0
Voluntary Context Switches 3878
Involuntary Context Switches 3525
Block Input Operations 0
Block Output Operations 0
2. 时间长的日志
MPRINT(AA): data temp.ti_asc_pt_stock;
MPRINT(AA): set temp.tm_ASC_PT_STOCK(firstobs=9600033 obs=9900033);
MPRINT(AA): modify temp.ti_asc_pt_stock key=idx3;
MPRINT(AA): if _iorc_ ne 0 then do;
MPRINT(AA): output;
MPRINT(AA): _error_=0;
MPRINT(AA): end;
MPRINT(AA): run;
NOTE: There were 300001 observations read from the data set TEMP.TM_ASC_PT_STOCK.
NOTE: The data set TEMP.TI_ASC_PT_STOCK has been updated. There were 0 observations rewritten, 300001 observations added and 0
observations deleted.
NOTE: DATA statement used (Total process time):
real time 55:26.39
user cpu time 14.36 seconds
system cpu time 1:23.06
memory 835.78k
OS Memory 5412.00k
Timestamp 2013- 9- 5 上午04时17分09秒
Page Faults 1545998
Page Reclaims 670381
Page Swaps 0
Voluntary Context Switches 3940
Involuntary Context Switches 30255
Block Input Operations 0
Block Output Operations 0