Query Entity throwing error while retrieving the data for total count

Certified Senior Developer

Hi All,

I am having a weird issue in executing the query entity. I have a query entity rule which returns the totalcount based on the date range(which is ideally current date/day). It is throwing error in some scenarios and testing this rule certain time, we can see the data is being populated.

Any help would be highly appreciated.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    If you're querying only to get the TotalCount, your PagingInfo should pass in a BatchSize of zero, which will cause the query to return zero rows of data (but it should still return an accurate TotalCount).  I notice you're already passing in a BatchSize of 1, but using 0 will be just one notch more potentially efficient for this use case.

    However the fact that you're getting this error even with a batchsize of 1 suggests, as others have pointed out, that your query might be timing out.  What happens when you run a simple SQL query on the data directly in the DB?  I've found that in the case of queries that don't perform well on the Appian side to this extent, there's also an accompanying obvious-to-severe delay when running a SQL query - typically this has been in Views with severe inefficiencies accidentally included, or actual breaking bugs.

Reply
  • 0
    Certified Lead Developer

    If you're querying only to get the TotalCount, your PagingInfo should pass in a BatchSize of zero, which will cause the query to return zero rows of data (but it should still return an accurate TotalCount).  I notice you're already passing in a BatchSize of 1, but using 0 will be just one notch more potentially efficient for this use case.

    However the fact that you're getting this error even with a batchsize of 1 suggests, as others have pointed out, that your query might be timing out.  What happens when you run a simple SQL query on the data directly in the DB?  I've found that in the case of queries that don't perform well on the Appian side to this extent, there's also an accompanying obvious-to-severe delay when running a SQL query - typically this has been in Views with severe inefficiencies accidentally included, or actual breaking bugs.

Children
No Data