Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Sorting and Searching Arrays Becomes More Manageable in V5R3

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Sorting and Searching Arrays Becomes More Manageable in V5R3

    ** This thread discusses the article: Sorting and Searching Arrays Becomes More Manageable in V5R3 **
    Hi Dave400, Just so we're on the same page, there is no "NBRRCDS" on the SEQONLY parm. SEQONLY looks like this: SEQONLY(*YES 100). There is an individual NBRRCDS parm for OVRDBF, which David A used in his example. The NBRRCDS specifies how many records to read from disk into main memory and can work for both sequential and direct access. The SEQONLY parms specifies how many records to read from disk into the program buffer and only works for sequential processing. With either case, there's no guarantee that the record a program needs will still be in memory when the program needs that given record. A disk read may still be needed, even for a small file. If a program is blocking lots of different files or many jobs/programs are consuming lots of memory, something has to acquiesce at some point. Chris

    Comment


    • #17
      Sorting and Searching Arrays Becomes More Manageable in V5R3

      ** This thread discusses the article: Sorting and Searching Arrays Becomes More Manageable in V5R3 **
      Chris OK I think we are on the same page. Secondly I think the use of dynamic arrays are valid in certain situations. ..there is no "NBRRCDS" on the SEQONLY parm. SEQONLY looks like this: SEQONLY(*YES 100). I've always termed the 100 as Number of Records. What should I call it ? With either case, there's no guarantee that the record a program needs will still be in memory when the program needs that given record. Agreed unless you put that file into a dedicated storage pool with SETOBJACC. The lack of guarantee is also true if you using the internal array method. And if you have 100 copies of the program running there will be 100 copies of the array. Instance 1 Program A would get absolutely no benefit from instance 70 having just accessed the information. RAM operates on billionths of a second, disk reads on thousanths of a second. So, the bottleneck in most any program will not be reallocating memory once in a while but rather disk I/O. I am not sure that statement is 100% correct since a cache miss on the iSeries takes 100 cycles to access from memory. But your point of memory access time being orders of magniture is correct. What I dont understand is why would the array be more likely to be in memory then the database record ? I think the real saving here is in CPU cyles in not having to go through the database code at all. In the case of multiple concurrent users of the array it may be better to have a single instance of the cache/array ? Perhaps in a User Index. Using the internal arrays restricts maintenance capability. If an element is added/changed/deleted then programs need to be exited for the the change to apply.

      Comment


      • #18
        Sorting and Searching Arrays Becomes More Manageable in V5R3

        ** This thread discusses the article: Sorting and Searching Arrays Becomes More Manageable in V5R3 **
        Dave400 wrote: I believe this would only guarantee that your program would need to block each time it performs a read until the entire file was retrieved into memory This does occur on the first read. From that point on, all of the records are in main storage. Try it for yourself Caveat This technique is only recommended for small files (65k or under). Dave

        Comment


        • #19
          Sorting and Searching Arrays Becomes More Manageable in V5R3

          ** This thread discusses the article: Sorting and Searching Arrays Becomes More Manageable in V5R3 **
          This does occur on the first read. From that point on, all of the records are in main storage. Try it for yourself AFAIK there is no way to "freeze" or "pin" a user object in memory. The best you could do is create a dedicated subsystem and SETOBJACC of the file into that subsystem.

          Comment

          Working...
          X