Home > database >  Oracle table, query optimization
Oracle table, query optimization

Time:10-06

Good god, I am a newcomer, the following this statement takes longer: what advice can optimize it for me?? Time spent in the subquery u.u serid=t.t alkuserid this statement, thank you
The select u. *,
(select the deptname from EADEPT d where d.d eptid=u.d eptid) as the deptname,
"E.r oleid,
E.a uthorizeid,
R.r olename,
C.s. uggestion as propose,
C.t alkresultscore as talksituation,
C.p syexaminescores as checkpsyscore,
C.p riexcepscores as checkpriscore,
C.p syexaminesum as checkpsysum,
C.p riexcepsum as checkprisum,
C.p syexaminefinish as checkpsyfinish,
C.p riexcepfinish as checkprifinish,
(select count (*) from talk_plan t inner join (select offenderid from offender_info) o on t.o ffenderid=o.o ffenderid
Where u.u serid=t.t alkuserid AND
T.t alktime & gt;=1451577600000
AND t.t alktime & lt;=1483199999000
And t.s Tate (10, 20)) in the as countstalk,
(select count (*) from talk_plan t left to join (select offenderid, ZKLB from offender_info) o on t.o ffenderid=o.o ffenderid
Where t.s Tate in (10, 20)
And u.u serid=t.t alkuserid
And (o.z KLB in (' 1 ', '2', '3') or appointsign='1' or plantype=4)) as alimportanttalk,
(select count (*) from talk_plan t left to join (select offenderid, ZKLB from offender_info) o on t.o ffenderid=o.o ffenderid
Where t.s Tate in (10, 20, 1)
And u.u serid=t.t alkuserid
And (o.z KLB in (' 1 ', '2', '3') or appointsign='1' or plantype=4)) as alltalkcount
The from eauser u
Inner join (select roleid, authorizeid, userid from eauserauthorize) e on e.u serid=u.u serid
Left the join (select roleid, rolename the from earole) r on "e.r oleid=r.r oleid
Left the join checkuserscore c on u.u serid=c.u serid and Arthur c. heckscoretime=1483199999000
Where 1=1
AND "e.r oleid in (10000120, 10000124, 10000126, 10000127, 10000128)

CodePudding user response:

Help you a great god

CodePudding user response:

Look at u.u serid=t.t alkuserid
Corresponding to the amount of data, what connection NL, HASH
Didn't go the corresponding index
  • Related