rownum=1000 与 rown<=1000 速度不一样哦!

按常理来讲 rownum=1000   取第1000行的数据 一条

 rown<=1000  取1000行数据 多条。

第一个数据量远小于第二条 ,然而比它还慢!

 

select F_ADDTIME,F_PAYCODE,t.f_note,
  (CASE WHEN l.F_INOUT=0 THEN F_PAYMONEY END) AS MEONYOUT,
  (CASE WHEN l.F_INOUT=1 THEN F_PAYMONEY END) AS MEONYIN,
  F_POUNDAGE,F_HASPAY,F_CONTENT,F_ADMINNOTE,F_ADMINNAME
   from T_gather_UserPayLog L
  INNER JOIN t_base_user_pay_Type T on l.f_busino=t.f_id
  WHERE F_BuySuc=1
 and rownum=1000

 

SELECT STATEMENT, GOAL = ALL_ROWS  IO cost=274926  Time=3425 Cardinality=114351052 Bytes=13950828344
 COUNT      
  FILTER      
   HASH JOIN  IO cost=274926  Time=3425 Cardinality=114351052 Bytes=13950828344
    TABLE ACCESS FULL Object name=T_BASE_USER_PAY_TYPE IO cost=5  Time=1 Cardinality=725 Bytes=17400
    PARTITION RANGE ALL  IO cost=274921  Time=3409 Cardinality=114351052 Bytes=11206403096
     TABLE ACCESS FULL Object name=T_GATHER_USERPAYLOG IO cost=274921  Time=3409 Cardinality=114351052 Bytes=11206403096

 

 and rownum<=1000

SELECT STATEMENT, GOAL = ALL_ROWS  IO cost=9  Time=1 Cardinality=1000 Bytes=220000
 COUNT STOPKEY      
  HASH JOIN  IO cost=9  Time=1 Cardinality=114351052 Bytes=25157231440
   TABLE ACCESS FULL Object name=T_BASE_USER_PAY_TYPE IO cost=5  Time=1 Cardinality=725 Bytes=17400
   PARTITION RANGE ALL  IO cost=4  Time=1 Cardinality=1003 Bytes=98294
    TABLE ACCESS FULL Object name=T_GATHER_USERPAYLOG IO cost=4  Time=1 Cardinality=1003 Bytes=98294

你可能感兴趣的:(JOIN,user,filter,table,Access)