|
Tom - I'll jump in here - the calculation has to be done for every
record you are testing - this prevents the use of any index on
A.artxyr.
This is generally true, and may depend on where the calculation is.
Also, I'm inclined to think implicit casts may have some bearing on
performance. Not sure, would have to run through Visual Explain to
see.
In this case, it'd be easy enough to run 2 SELECTs in Navigator, one
with this concatenation of 2011 and a constant that is a valid value
for RPTTXYR. The other would use directly the value that resulted
from the concatenation.
On 5/30/2012 10:06 AM, Tom E Stieger wrote:
On a side note, why does this matter for performance?
Birgitta Hauser on Tuesday, May 29, 2012 10:38 PM wrote:
Scott Klement on Tuesday, 29.5 2012 23:58 wrote:
This line looks suspicious to me:
and A.artxyr = 2011 || :RPTTXYR
To me too!
For performance issues you should avoid concatenating those
things in the SQL statement, calculate the variable value in your
RPG and use it as follows:
MyVar = '2011' + RPTTXYR;
Select ...
Where a.ARTXYR = :MyVar
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.