Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Server-side paging with CMSRepeater and UniViewer View modes: 
User avatar
Member
Member
matt.barry-stockhouse - 11/5/2012 4:43:33 PM
   
Server-side paging with CMSRepeater and UniViewer
Hello:

I'm trying to page through a large number of nodes with a CMSRepeater and UniViewer. However when I turn on CMSDebugSQLQueries it appears that the entire result set is queried from the database. Is there any way to have the CMSRepeater only query the nodes that it needs to render the current page?

Thanks!

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/7/2012 6:31:51 AM
   
RE:Server-side paging with CMSRepeater and UniViewer
Hi,

Have you tried using the Universal pager web part and connect it with the repeater?

Best regards,
Juraj Ondrus

User avatar
Member
Member
matt.barry-stockhouse - 11/7/2012 12:34:37 PM
   
RE:Server-side paging with CMSRepeater and UniViewer
Yes, sorry for the confusion. I said UniViewer in my original post, but I meant UniPager.

So I have something like this...

<cms:CMSRepeater ID="rptArticles" runat="server" Path="./%" DelayedLoading="True" SelectOnlyPublished="True" EnableViewState="False" 
ClassNames="ContentItem" Columns="DocumentID, DocumentName, NodeAliasPath, Author, Deck, PublishDate" OrderBy="PublishDate DESC">
...
</cms:CMSRepeater>
<cms:unipager id="UniPager1" runat="server" PageControl="rptArticles" pagermode="Querystring" PageSize="10" HidePagerForSinglePage="True">
...
</cms:unipager>


Unfortunately this is querying all of the "ContentItems". And I have a lot of them. I'd like to only query the 10 I need for the current page.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/8/2012 7:31:21 AM
   
RE:Server-side paging with CMSRepeater and UniViewer
Hi,

Are you checking it in the live site or in the preview mode?
What are your caching options? These data should be cached and then just the cached dataset should be paged.

Best regards,
Juraj Ondrus

User avatar
Member
Member
matt.barry-stockhouse - 11/8/2012 12:44:15 PM
   
RE:Server-side paging with CMSRepeater and UniViewer
Live site.

Here's the query that gets generated by the CMSRepeater/UniViewer:

SELECT DocumentID, DocumentName, NodeAliasPath, Author, Deck, PublishDate, DocumentCulture, NodeID, NodeLinkedNodeID, SiteName, ClassName FROM View_Stockhouse_ContentItem_Joined WHERE ((((NodeSiteID = 3) AND (Published = 1)) AND (DocumentCulture = N'en-US')) AND (NodeAliasPath LIKE N'/Opinion/Independent-Reports/%')) ORDER BY PublishDate DESC


This query takes 2.5 seconds to execute and returns 1.9MB of data. I have caching turned off because I don't want to mask performance problems in pre-production code.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/8/2012 10:29:07 PM
   
RE:Server-side paging with CMSRepeater and UniViewer
Hi,

Well, that is the purpose of caching - to have the data available. If it is turned off, the data are in the DB only so they have to be requested each time. Where else should be the data kept if not in the memory - cache?

Best regards,
Juraj Ondrus

User avatar
Member
Member
matt.barry-stockhouse - 11/9/2012 5:18:55 PM
   
RE:Server-side paging with CMSRepeater and UniViewer
You are correct. I should not waste time optimizing slow queries. Instead I will purchase more memory and cache the entire database.