数据库语句优化

写了一个批量插入的语句,具体格式为select xxyyfrom   a left join b on a.xx = b.xx left join c on b.jj = c.kk where a.yy in('','','')and exists(        select 1 from (xx...))为什么在客户端执行的时候报超时,用脚本执行时一直卡着...显示全部

写了一个批量插入的语句,具体格式为

select

xx

yy

from   a left join b on a.xx = b.xx left join c on b.jj = c.kk

where a.yy in('','','')

and exists(

        select 1 from (

xx...

)

)

为什么在客户端执行的时候报超时,用脚本执行时一直卡着不动?望大神解答

收起
参与15

查看其它 2 个回答redgreat的回答

redgreatredgreat数据库管理员leadcom

表关联有点多,先看执行计划该加索引的加加索引;还有就是不行就用临时表,不知道db2sql支持with as不.

系统集成 · 2017-04-20
浏览1519

回答者

redgreat
数据库管理员leadcom

redgreat 最近回答过的问题

回答状态

  • 发布时间:2017-04-20
  • 关注会员:4 人
  • 回答浏览:1519
  • X社区推广