Select-FetchNext create "select *" query to get 1 variable
The problem was in F42119.Select and F42119.FetchNext part of algorithm that frequently started to slow down application and increased fragmentation of data in F42119.
Generates query:
SELECT *
FROM PRODDTA.F42119
WHERE ((SDDCT = 'RI' AND SDDCTO = 'SP' AND SDLTTR < '980' AND SDKCO = '01000' AND SDDOCO = 4461413 AND SDDOC = 2206525 AND SDKCOO = '01000' ))
ORDER BY SDDOCO ASC , SDDCTO ASC , SDKCOO ASC , SDLNID ASC
Used Indexes - correct and in FetchNext is only 1 variable SDSHPN, but instead of “SELECT *” should be “SELECT SDSHPN”, because it’s the only field used in F42119.FetchNext part.
How can we make JDE create more correct query?