德比选择查询只是挂起

时间:2018-11-14 00:38:47

标签: select derby

我正在通过IJ在Derby中运行以下查询:

select count(*) as cnt, factor from sp500_2003 
       where unq_seq in (select distinct unq_seq from sp500_2003
                          where factor = 'ZEC_11')  
group by factor;

该表包含522,000条记录,如下所示:

30100045BETA,200301,45,20030100045,ADCT,A D C TELECOMMUNICATIONS,BETA,BETA,2.208
30100045FAC_11,200301,45,20030100045,ADCT,A D C TELECOMMUNICATIONS,FAC_11,VOLTILTY,2.833
30100045FAC_12,200301,45,20030100045,ADCT,A D C TELECOMMUNICATIONS,FAC_12,MOMENTUM,-1.194
30100045FAC_13,200301,45,20030100045,ADCT,A D C TELECOMMUNICATIONS,FAC_13,SIZE_A,-1.824
30100045FAC_14,200301,45,20030100045,ADCT,A D C TELECOMMUNICATIONS,FAC_14,SIZENONL,-0.362
30100045FAC_15,200301,45,20030100045,ADCT,A D C TELECOMMUNICATIONS,FAC_15,TRADEACT,0.45
30100045FAC_16,200301,45,20030100045,ADCT,A D C TELECOMMUNICATIONS,FAC_16,GROWTH,0.706
30100045FAC_17,200301,45,20030100045,ADCT,A D C TELECOMMUNICATIONS,FAC_17,EARNYLD,-2.851

第一列定义为主键。

查询就在那儿。无论如何,可以使查询更快

0 个答案:

没有答案