日期:2014-05-17  浏览次数:20671 次

java sql 查询50条数据 1.700秒 算快吗
sql 语句如下:

select *
  from (select t.user_id,
  ent_name,
  decl_reg_no,
  ori_reg_no,
  linkman,
  linkman_photo,
  mobile_telephone,
  electrograph,
  ent_address,
  email,
  f_gethuifangdate(t.user_id, t.corp_code) as reg,
  account_total,
  oper_user,
  to_char(oper_date, 'yyyy-mm-dd') as oper,
  linkman2,
  linkman_photo2,
  ent_namesimple,
  user_code,
  t.corp_code,
  lihua_account,
  balance_date,
  arrearage_date,
  client_type,
  deposit,
  nvl(fee_total, 0) as qiankuan_date,
  f_getbalamode(charge_type) as charge_type,
  liushi,
  officeno,
  a.cnum,
  f_getqiankuandate(t.user_id, t.corp_code) as day,
  officeno1,
  liushicause,
  f_getHandler(t.handler, corp_code) as handler,
  to_char(cause_date, 'yyyy-mm-dd') as ca,
  ent_bankaccount,
  ts_memo,
  Finance_ren,
  Finance_tel,
  legal,
  Legal_tel,
  Trade_address,
  Trade_tel,
  Trade_fax,
  Trade_linker,
  Trade_linker_tel,
  Trade_legal,
  Trade_legal_tel,
  min_account,
  sub_account,
  member_type,
  soru,
  dijiao
  from (select user_id, count(*) as cnum
  from (select user_id
  from hdyw_ywdjmx
  where fee_status = '2'
  and flow_status <> '7'
  and (cd_flag is null or cd_flag = '0')
  and corp_code = 'hd'
  union all
  select user_id
  from hdyw_ywdjmx_archives
  where fee_status = '2'
  and (flow_status <> '7')
  and (cd_flag is null or cd_flag = '0')
  and corp_code = 'hd')
  group by user_id) a,
  (select user_id,
  sum(fee_total) as fee_total,
  sum(soru) as soru,
  sum(dijiao) as dijiao
  from (select pay_entid as user_id,
  sum((sub_charge + t.ori_charge +
  f_getFareNum(yw_id, '3') +
  f_getfare(yw_id, '1') + express_fare +
  other_fare)) as fee_total,
  sum(sub_charge + t.ori_charge +
  f_getFareNum(yw_id, '2')) as soru,
  sum(f_getfare(yw_id, '1') +