SAP BASIS st05 statment hint opt and select distinct table for condition create secondary index

** Myself
st05
clip_image002
-> Enter SQL Statement
Put Statement
clip_image004
Show statement hint and Index for distinct table compare row for optimizer usage
clip_image006
In case can’t select create in st04 can be distinct in database for compare distinct value for create secondary index



clip_image008
--For oracle 
-- test EBAN table  production client 900 and compare each field (ESTKZ,BSTYP,FRGKZ,EBELN,..)
SQL> -- Count ESTKZ
SQL> select count(distinct ESTKZ)
2 from SAPR3.EBAN
3 where MANDT like '900'
4 /
COUNT(DISTINCTESTKZ)
--------------------
5
SQL> -- Count BSTYP
SQL> select count(distinct BSTYP)
2 from SAPR3.EBAN
3 where MANDT like '240'
4 /
COUNT(DISTINCTBSTYP)
--------------------
1
SQL> -- Count FRGKZ
SQL> select count(distinct FRGKZ)
2 from SAPR3.EBAN
3 where MANDT like '240'
4 /
COUNT(DISTINCTFRGKZ)
--------------------
15
SQL> -- Count LOEKZ
SQL> select count(distinct FRGKZ)
2 from SAPR3.EBAN
3 where MANDT like '240'
4 /
COUNT(DISTINCTFRGKZ)
--------------------
15
SQL> -- Count EBELN
SQL> select count(distinct EBELN)
2 from SAPR3.EBAN
3 where MANDT like '240'
4 /
COUNT(DISTINCTEBELN)
--------------------
4437770
SQL> -- Count FRGKZ
SQL> select count(distinct FRGKZ)
2 from SAPR3.EBAN
3 where MANDT like '240'
4 /
COUNT(DISTINCTFRGKZ)
--------------------
15
SQL> -- Count EKGRP
SQL> select count(distinct EKGRP)
2 from SAPR3.EBAN
3 where MANDT like '240'
4 /
COUNT(DISTINCTEKGRP)
--------------------
894
SQL> -- Count WERKS
SQL> select count(distinct WERKS)
2 from SAPR3.EBAN
3 where MANDT like '240'
4 /
COUNT(DISTINCTWERKS)
--------------------
950
SQL> spool off

0 comments:

Loading