Manage Learn to apply best practices and optimize your operations.

Don't use GetNthDocument

The GetNthDocument method is widely publicized as the way to loop through a collection.

The GetNthDocument method is widely publicized as the way to loop through a collection.

It works - within a loop, you will progress through a collection and successfully process all documents.

However - on a medium to huge collection, processing speed will deteriorate dramatically.

Why? - because position in the collection is re-established on every GetNthDocument by counting upwards from the first document each and every time. Thus, performance deteriorates as the position increases.

What else then? - Use the GetFirstDocument and GetNextDocument methods in all your collection and see your code speed along!

As a guide, one relatively simple agent running against 110,000 documents took 48+ hours using GetNthDocument and less than 1.5 hours when GetFirstDocument and GetNextDocument was used.


Dig Deeper on Domino Resources - Part 4

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close