Trading Networks Large Query Performance

I am wondering how the webMethods architecture works when Trading Networks database is queried from the tn.query folder in the WmTN package or queried from MWS. I have seen in the Trading Networks Administrators Guide that it mentions that a certain number of query results are stored in a session object on Integration Server, and the rest are stored in Ehcache. Is this always the case?

Specifically I want to know when I query Trading Networks documents and use pagination to process all records, I’m wondering what the server impact will be. Say that I run a query that contains 1,000,000 records, and I return an enumeration ID to process the 1,000,000 records by 50 records at a time, are the remaining records that have not been processed stored somewhere? For each page that I return, is the service reaching out to TN every time, or is it storing the remaining records in memory as mentioned above? Also, any recommendations on increasing performance with large TN queries so that I do not inhibit Integration Server performance when querying TN?