Home > database >  Oracle that is more efficient
Oracle that is more efficient

Time:09-21

The select orgName, planId,
(select plan_name from DRGS_INDEX_ESTIMATE_PLAN where plan_id=planId and rownum=1) as planName,
Rank () over (ORDER BY total desc) as totalRanking,
Total,
AAll,
EAll,
CAll,
QAll,
A002IndexScore,
A002IndexWeight,
A002IndexValue,
E002IndexScore,
E002IndexWeight,
E002IndexValue,
E001IndexScore,
E001IndexWeight,
E001IndexValue,
Q001IndexScore,
Q001IndexWeight,
Q001IndexValue
The from (
Select
As ORG_NAME orgName,
PLAN_ID as planId,
ROUND (avg (TOTAL), 2) as the TOTAL,
ROUND (avg (A_ALL), 2) the as aAll,
ROUND (avg (E_ALL), 2) the as eAll,
ROUND (avg (C_ALL), 2) as the cAll,
ROUND (avg (Q_ALL), 2) the as qAll,
ROUND (avg (A002_INDEX_SCORE), 2) the as a002IndexScore,
ROUND (avg (A002_INDEX_WEIGHT), 2) the as a002IndexWeight,
ROUND (avg (A002_INDEX_VALUE), 2) the as a002IndexValue,
ROUND (avg (E002_INDEX_SCORE), 2) the as e002IndexScore,
ROUND (avg (E002_INDEX_WEIGHT), 2) the as e002IndexWeight,
ROUND (avg (E002_INDEX_VALUE), 2) the as e002IndexValue,
ROUND (avg (E001_INDEX_SCORE), 2) the as e001IndexScore,
ROUND (avg (E001_INDEX_WEIGHT), 2) the as e001IndexWeight,
ROUND (avg (E001_INDEX_VALUE), 2) the as e001IndexValue,
ROUND (avg (Q001_INDEX_SCORE), 2) the as q001IndexScore,
ROUND (avg (Q001_INDEX_WEIGHT), 2) the as q001IndexWeight,
ROUND (avg (Q001_INDEX_VALUE), 2) the as q001IndexValue
The from (
Select
(select area_name from DRGS_BUILT_AREA where AREA_CODE=
(select AREA_CODE from UP_ORG_UNIT where ID=ORG_ID)
And a_level='2' and rownum=1) as ORG_NAME,
PLAN_ID,
TOTAL,
A_ALL,
E_ALL,
C_ALL,
Q_ALL,
A002_INDEX_SCORE,
A002_INDEX_WEIGHT,
A002_INDEX_VALUE,
E002_INDEX_SCORE,
E002_INDEX_WEIGHT,
E002_INDEX_VALUE,
E001_INDEX_SCORE,
E001_INDEX_WEIGHT,
E001_INDEX_VALUE,
Q001_INDEX_SCORE,
Q001_INDEX_WEIGHT,
Q001_INDEX_VALUE
The from v_index_esti_score_detail where plan_id='4028468162 e1221b0162e1b19ad100d0 and ORG_DIM=' 10 ')
Where ORG_NAME is not null
Group by ORG_NAME, PLAN_ID)

The select orgName, planId,
(select plan_name from DRGS_INDEX_ESTIMATE_PLAN where plan_id=planId and rownum=1) as planName,
Rank () over (ORDER BY total desc) as totalRanking,
Total,
AAll,
EAll,
CAll,
QAll,
A002IndexScore,
A002IndexWeight,
A002IndexValue,
E002IndexScore,
E002IndexWeight,
E002IndexValue,
E001IndexScore,
E001IndexWeight,
E001IndexValue,
Q001IndexScore,
Q001IndexWeight,
Q001IndexValue
The from (
Select
As ORG_NAME orgName,
PLAN_ID as planId,
ROUND (avg (TOTAL), 2) as the TOTAL,
ROUND (avg (A_ALL), 2) the as aAll,
ROUND (avg (E_ALL), 2) the as eAll,
ROUND (avg (C_ALL), 2) as the cAll,
ROUND (avg (Q_ALL), 2) the as qAll,
ROUND (avg (A002_INDEX_SCORE), 2) the as a002IndexScore,
ROUND (avg (A002_INDEX_WEIGHT), 2) the as a002IndexWeight,
ROUND (avg (A002_INDEX_VALUE), 2) the as a002IndexValue,
ROUND (avg (E002_INDEX_SCORE), 2) the as e002IndexScore,
ROUND (avg (E002_INDEX_WEIGHT), 2) the as e002IndexWeight,
ROUND (avg (E002_INDEX_VALUE), 2) the as e002IndexValue,
ROUND (avg (E001_INDEX_SCORE), 2) the as e001IndexScore,
ROUND (avg (E001_INDEX_WEIGHT), 2) the as e001IndexWeight,
ROUND (avg (E001_INDEX_VALUE), 2) the as e001IndexValue,
ROUND (avg (Q001_INDEX_SCORE), 2) the as q001IndexScore,
ROUND (avg (Q001_INDEX_WEIGHT), 2) the as q001IndexWeight,
ROUND (avg (Q001_INDEX_VALUE), 2) the as q001IndexValue
The from (
Select
C.a. rea_name as ORG_NAME,
PLAN_ID,
TOTAL,
A_ALL,
E_ALL,
C_ALL,
Q_ALL,
A002_INDEX_SCORE,
A002_INDEX_WEIGHT,
A002_INDEX_VALUE,
E002_INDEX_SCORE,
E002_INDEX_WEIGHT,
E002_INDEX_VALUE,
E001_INDEX_SCORE,
E001_INDEX_WEIGHT,
E001_INDEX_VALUE,
Q001_INDEX_SCORE,
Q001_INDEX_WEIGHT,
Q001_INDEX_VALUE
The from v_index_esti_score_detail a, UP_ORG_UNIT b, DRGS_BUILT_AREA c where _ID=a.ORG b.i d and b.A REA_CODE=c.a. REA_CODE and c.a. _level='2' and plan_id='4028468162 e1221b0162e1b19ad100d0 and ORG_DIM=' 10 ')
Where ORG_NAME is not null
Group by ORG_NAME, PLAN_ID)

CodePudding user response:

See time-consuming that bar, oh almost

CodePudding user response:

The first SQL efficiency higher ~

CodePudding user response:

If can carry out, it is recommended to use dbms_xplan. Display_cursor compare logical reads (of course the use up sqlplus autotrace also available), and see whether there are still some bottlenecks, whether can also be optimized? Merely a F5 information is too little, the predicate information all have no
  • Related