GBase南大通用8aSql 语句并发执行性能差

描述:

GBase南大通用8aSql 语句并发执行性能差:
select *
from (select *
from (select rowid as id,
‘1’ as item1,
OrignialCallingParty as item2,
OrignialCalledParty as item3,
TariffInfo as item4,
BalanceInfo as item5,
to_char(CallDuriation) as item6,
to_char(SessionBeginTime, ‘YYYYMMDDHH24MISS’) as item7, SessionTerminatedTime as item8,
RoamingType as item9,
to_char(CallingPartyLacId) as item10,
PayTime as time,
‘’ || LongDistanceType as item11,
ServiceScenarious as item12,
‘201310’ as tbName,
CallingPartyCellId || ‘,’ || CalledPartyCellId as item13, ‘13026800298’ as phone
from voice_cdr_201310
where ChargedParty = ‘8613026800298’
and SessionBeginTime >= ‘2013-09-01 00:00:00’
and SessionBeginTime <= ‘2013-10-08 11:25:51’
and single_flag = 1
order by item7 desc limit 50) a

union all
select *
from (select rowid as id,
‘1’ as item1,
OrignialCallingParty as item2,
OrignialCalledParty as item3,
TariffInfo as item4,
BalanceInfo as item5,
to_char(CallDuriation) as item6,
to_char(SessionBeginTime, ‘YYYYMMDDHH24MISS’) as item7, SessionTerminatedTime as item8,
RoamingType as item9,
to_char(CallingPartyLacId) as item10,
PayTime as time,
‘’ || LongDistanceType as item11,
ServiceScenarious as item12,
‘201309’ as tbName,
CallingPartyCellId || ‘,’ || CalledPartyCellId as item13, ‘13026800298’ as phone
from voice_cdr_201309
where ChargedParty = ‘8613026800298’
and SessionBeginTime >= ‘2013-09-01 00:00:00’
and SessionBeginTime <= ‘2013-10-08 11:25:51’
and single_flag = 1
order by item7 desc limit 50) b
union all
select *
from (select rowid as id,
‘1’ as item1,
OrignialCallingParty as item2,
OrignialCalledParty as item3,
TariffInfo as item4,
BalanceInfo as item5,
to_char(CallDuriation) as item6,
to_char(SessionBeginTime, ‘YYYYMMDDHH24MISS’) as item7, SessionTerminatedTime as item8,
RoamingType as item9,
to_char(CallingPartyLacId) as item10,
PayTime as time,
‘’ || LongDistanceType as item11,
ServiceScenarious as item12,
‘20131008’ as tbName,
CallingPartyCellId || ‘,’ || CalledPartyCellId as item13, ‘13026800298’ as phone

from voice_cdr_20131008
where ChargedParty = ‘8613026800298’
and SessionBeginTime >= ‘2013-09-01 00:00:00’ and SessionBeginTime <= ‘2013-10-08 11:25:51’ and single_flag = 1
order by item7 desc limit 50) c) a
order by item7 desc limit 0, 50;

解决办法:

GBase南大通用8a语句改写:
(select rowid as id,
‘1’ as item1,
OrignialCallingParty as item2,
OrignialCalledParty as item3,
TariffInfo as item4,
BalanceInfo as item5,
to_char(CallDuriation) as item6,
to_char(SessionBeginTime, ‘YYYYMMDDHH24MISS’) as item7, SessionTerminatedTime as item8,

RoamingType as item9,
to_char(CallingPartyLacId) as item10,
PayTime as time,
‘’ || LongDistanceType as item11,
ServiceScenarious as item12,
‘201310’ as tbName,
CallingPartyCellId || ‘,’ || CalledPartyCellId as item13, ‘13026800298’ as phone
from voice_cdr_201310
where ChargedParty = ‘8613026800298’
and SessionBeginTime >= ‘2013-09-01 00:00:00’
and SessionBeginTime <= ‘2013-10-08 11:25:51’
and single_flag = 1)
union
(select rowid as id,
‘1’ as item1,
OrignialCallingParty as item2,
OrignialCalledParty as item3,
TariffInfo as item4,
BalanceInfo as item5,
to_char(CallDuriation) as item6,
to_char(SessionBeginTime, ‘YYYYMMDDHH24MISS’) as item7, SessionTerminatedTime as item8,
RoamingType as item9,
to_char(CallingPartyLacId) as item10,

PayTime as time,
‘’ || LongDistanceType as item11,
ServiceScenarious as item12,
‘201309’ as tbName,
CallingPartyCellId || ‘,’ || CalledPartyCellId as item13, ‘13026800298’ as phone
from voice_cdr_201309
where ChargedParty = ‘8613026800298’
and SessionBeginTime >= ‘2013-09-01 00:00:00’
and SessionBeginTime <= ‘2013-10-08 11:25:51’
and single_flag = 1)
union
(select rowid as id,
‘1’ as item1,
OrignialCallingParty as item2,
OrignialCalledParty as item3,
TariffInfo as item4,
BalanceInfo as item5,
to_char(CallDuriation) as item6,
to_char(SessionBeginTime, ‘YYYYMMDDHH24MISS’) as item7, SessionTerminatedTime as item8,
RoamingType as item9,
to_char(CallingPartyLacId) as item10,
PayTime as time,
‘’ || LongDistanceType as item11,
ServiceScenarious as item12,
‘20131008’ as tbName,
CallingPartyCellId || ‘,’ || CalledPartyCellId as item13, ‘13026800298’ as phone
from voice_cdr_20131008
where ChargedParty = ‘8613026800298’
and SessionBeginTime >= ‘2013-09-01 00:00:00’
and SessionBeginTime <= ‘2013-10-08 11:25:51’
and single_flag = 1)
order by item7 desc limit 0, 50。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值