Paging and cte query

Posts   
 
    
mortenarp
User
Posts: 1
Joined: 16-Jun-2011
# Posted on: 16-Jun-2011 15:15:18   

According to this page:

http://www.llblgen.com/documentation/2.6/Using%20the%20generated%20code/SelfServicing/gencode_paging.htm

Paging is achieved through a cte query that only collects the necessary rows for the current "page" However we have some querys that timeout, and investigations shows us that the entire collections is retrieved (via sql)

What can we be doing wrong?

Code: itemCollection.GetMulti(filter, 0, sortExpression, relations, prefetchPath, pageNumber, maximumRows);

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 16-Jun-2011 20:40:11   

The usual cause is that the paging cannot happen on the db due to a "DISTINCT" clause not being able to be applied to the query.

This is discussed in more detail in the following thread

http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=11928&HighLight=1

Matt