Hi,
I have this curiosity regarding the performance impact of having a NOT EQUAL TO condition in the WHERE clause of a SELECT query. Please provide your inputs and reasoning on the performance impact on the below 2 scenarios.
1. SELECT knumv kposn kbetr
FROM konv
INTO TABLE it_konv
FOR ALL ENTRIES IN it_ekko
WHERE knumv = it_ekko-knumv.
IF sy-subrc = 0.
DELETE it_konv WHERE kbetr IS INITIAL.
ENDIF.
2. SELECT knumv kposn kbetr
FROM konv
INTO TABLE it_konv
FOR ALL ENTRIES IN it_ekko
WHERE knumv = it_ekko-knumv AND
kbetr <> lv_zero. "Initial or 0 value.
Between the two of the above scenarios, can you please help me evaluate which would have a better overall performance and why.
I am more interested in knowing the reason for the difference in performance probably with respect to index and DB optimizer than a direct answer that scenario 1 or 2 would work faster.
Appreciate the help.
Thanks in advance.
-Justine.