2007 Jun 26 3:33 PM
Hi Experts,
I hv 2 different SQLs in same prog., like,
<i>SELECT DISTINCT bname
INTO TABLE bname_itab
FROM vbak
WHERE ernam IN s_ernam
AND bname NE space
AND auart IN s_auart
AND vkorg IN s_org
AND vtweg IN s_d_ch
AND spart IN s_div.</i>
SELECT vbeln into vbeln_itab
from vbak
where kunnr = s_kunnr
and kvgr2 = kvgr2.
So,
Already I hv one secondary index as Z02 for ernamauartvkorgvtwegspart
So, (performance point of view)
1 - Shuld I add kuunr + kvgr2 to the existing Z02 index?
2 - OR shalll I create a new one as Z03 with kunnr + kvgr2?
thanq.
2007 Jun 26 4:56 PM
Have you used the 'explain' function of ST05 to make sure that it is using the index for the first SELECT? The NE is going to cause problems.
Rob
Hi Experts,
I hv 2 different SQLs in same prog., like,
<i>SELECT DISTINCT bname
INTO TABLE bname_itab
FROM vbak
WHERE ernam IN s_ernam
AND bname NE space
AND auart IN s_auart
AND vkorg IN s_org
AND vtweg IN s_d_ch
AND spart IN s_div.</i>
SELECT vbeln into vbeln_itab
from vbak
where kunnr = s_kunnr
and kvgr2 = kvgr2.
So,
Already I hv one secondary index as Z02 for ernamauartvkorgvtwegspart
So, (performance point of view)
1 - Shuld I add kuunr + kvgr2 to the existing Z02 index?
2 - OR shalll I create a new one as Z03 with kunnr + kvgr2?
thanq.
2007 Jun 26 4:56 PM
Have you used the 'explain' function of ST05 to make sure that it is using the index for the first SELECT? The NE is going to cause problems.
Rob
2007 Jun 26 6:53 PM
ThanQ Rob,
No, I did not see the EXPLAIN function, will go thru it.
But, pls. let me clarify that,
How the NE operator in bname NE space, creates a problem?
thanq.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |