Pagination - Memory threshold issue.

We have a query as below
rule!WFT_getRequestDetailsBySearchParams(ri!process,ri!subprocess,ri!action,ri!requestor,ri!company,ri!reference,ri!sapRefNo,if(isnull(ri!fromDate),todatetime(date(2010,10,10)),ri!fromDate),if(isnull(ri!toDate),todatetime((today())),ri!toDate+intervalds(23,59,59)),ri!monetaryValue,ri!priority,ri!wftRequestID,ri!salesOffice,ri!requestStatus,ri!pageInfo)))

In the above query how is "ri!pageInfo" working? I could not find any parameters like batch size set for pageInfo. Please help how does it work for the above query.

How does pageInfo decrease the load on Appian? I have referred the below link, but did not understand much, Please help me on this.
forum.appian.com/.../System_Functions.html

OriginalPostID-254399

  Discussion posts and replies are publicly visible

Parents
  • @saicharanb No, batchSize = -1 while querying leads to memory threshold errors or performance issues. So prior to hitting the task in the flow, get all the required data and store it in a variable. And the way you get the data should be in form of batching. That is let's say you have 1000 records. Instead of giving a batchSize of -1 and querying at once, perform multiple queries. Let's choose an arbitrary number which doesn't effect the performance, maybe 100. Now you should be performing multiple queries as follows: rule!WFT_tempoSearchQueryPagination(a!pagingInfo(startIndex: 1,batchSize: 100)), rule!WFT_tempoSearchQueryPagination(a!pagingInfo(startIndex: 101,batchSize: 100)), rule!WFT_tempoSearchQueryPagination(a!pagingInfo(startIndex: 201,batchSize: 100)) and so on till rule!WFT_tempoSearchQueryPagination(a!pagingInfo(startIndex: 901,batchSize: 100)). This way, we get small amounts of data rather than trying to get entire data set in one shot which hampers the performance. Store all the data made from these queries in a PV and provide the same to the Paging Grid in the Forms Designer form which would look like todatasubset(pv!queriedData,data!pagingInfo) where the pv!queriedData is the variable that stores the results of the queries made as discussed above.
Reply
  • @saicharanb No, batchSize = -1 while querying leads to memory threshold errors or performance issues. So prior to hitting the task in the flow, get all the required data and store it in a variable. And the way you get the data should be in form of batching. That is let's say you have 1000 records. Instead of giving a batchSize of -1 and querying at once, perform multiple queries. Let's choose an arbitrary number which doesn't effect the performance, maybe 100. Now you should be performing multiple queries as follows: rule!WFT_tempoSearchQueryPagination(a!pagingInfo(startIndex: 1,batchSize: 100)), rule!WFT_tempoSearchQueryPagination(a!pagingInfo(startIndex: 101,batchSize: 100)), rule!WFT_tempoSearchQueryPagination(a!pagingInfo(startIndex: 201,batchSize: 100)) and so on till rule!WFT_tempoSearchQueryPagination(a!pagingInfo(startIndex: 901,batchSize: 100)). This way, we get small amounts of data rather than trying to get entire data set in one shot which hampers the performance. Store all the data made from these queries in a PV and provide the same to the Paging Grid in the Forms Designer form which would look like todatasubset(pv!queriedData,data!pagingInfo) where the pv!queriedData is the variable that stores the results of the queries made as discussed above.
Children
No Data