× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Paul Tuohy wrote:
>
> I think(?) Barbara was referring to Varying fields in RPG as opposed to 
>Varying fields defined in a database.
>
> The use of varying fields in a database are still a large "depends". There is 
>an overhead with any field whose contents exceed the constant portion defined 
>for every record. The extra characters are stored in
> an overflow area. Therefore, reading a record would probably require two 
>pages being input to memory.
> ...

I was indeed talking about program fields, but I'd also consider using
them in database fields.  When considering the performance of these
fields, you have to weigh the possible two-page fetch against the
reduced processing time in the programs.  By setting the VARLEN value
for the field correctly, you can minimize the possibility of the double
fetch.  With VARYING, it's not just the reduced %trim time, it's the
amount of data that's actually copied to/from the I/O buffers.  That's
the RPG side of the I/O - there are probably more data-copying
reductions on the database side.

In an application where -every- text-containing character field or
parameter was varying, the processing of those fields would be simpler
to code and probably faster if not much faster to execute.

If you have a mix of varying and non-varying in an application,
processing the fields may or may not be simpler.  But even if you do a
%trim on every character field "just in case", you will still get a
performance benefit from using varying fields, since the search for the
last non-blank will be faster when there are no trailing blanks.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.