Home > database >  SQL optimization
SQL optimization

Time:09-17

Select sum (NVL (a.y sje, 0) - NVL (a.s kje, 0)) ye, a.c ustcode, a.u nitcode
The from (select decode (zb DJDL, ys, sum (fb) Jfbbje), '0') ysje,
Decode (zb) DJDL, sk, sum (fb) ybye), '0') skje,
Bas custcode,
Corp., unitcode
The from arap_djzb zb
Left the join arap_djfb fb
On the zb. VOUCHID=fb. VOUCHID
Left the join bd_cumandoc man
On man. Pk_cumandoc=fb. Ksbm_cl
Left the join bd_cubasdoc bas
On bas. Pk_cubasdoc=man. Pk_cubasdoc
Left the join bd_corp corp
On corp., pk_corp=zb. DWBM
Where bas. Custcode='211200127'
- substr (bas. The custcode, 0, 2)='21'
And the zb. DJZT='2'
And corp., unitcode='10301'
And NVL (zb. Dr, 0)=0
And NVL (fb. Dr, 0)=0
Group by bas. Custcode, zb DJDL, corp., unitcode) a
Group by a.c ustcode, a.u nitcode


Associated with the terms of a few tables, let go also hundreds of data, query up particularly slow, bosses can optimize it

CodePudding user response:

Arap_djzb table? Through DJZT='2' the filtered data volume is how many?

Another execution plan put it,

CodePudding user response:

reference 1st floor minsic78 response:
arap_djzb table? Through DJZT='2' the filtered data volume is how many?

Additional execution plan put the


Supplement, arap_djzb table by DJZT='2' and NVL (Dr, 0)=0 condition the filtered data volume is how old?

CodePudding user response:

About 70000 article arap_djzb table data, filtered through DJZT="2" the amount of data that is more than 60000, DJZT='2' and NVL (Dr, 0)=0 conditions the filtered data volume is fifty-seven thousand

CodePudding user response:

reference qq_41391731 reply: 3/f
arap_djzb table there are about 70000 data, the filtered through DJZT="2" is the amount of data that more than 60000, DJZT='2' and NVL (Dr, 0)=0 condition the filtered data volume is fifty-seven thousand


If so, the query run to a few minutes is normal, and the traditional disk can only do this, you find a few times more, eliminate physical reflection, may be a little bit better,
  • Related