From: <km...@we...> - 2007-01-17 12:02:15
|
I do not really understand when the results are cached. Do eXist caches t= he sorted sequence in the following simple example: declare function myns:getResults($term) as element()* { for $ch in collection('/db/data')/element/child[starts-with(@att, $term)] let $att :=3D $ch/@att order by $att return <newelement id=3D"{$att}"> {$ch/title} </newelement> }; let $start :=3D request:get-parameter("start", "1") cast as xs:int, $results :=3D myns:getResults('1234') return subsequence($results, $start, 20) I think not. What di I have to do in order to let eXist cache the results= ? Sorry for my ignorance... Kai > -----Original Message----- > From: exi...@li... > [mailto:exi...@li...]On Behalf Of Michael > Beddow > Sent: Wednesday, January 17, 2007 10:54 AM > To: exi...@li... > Cc: Kai M=FCtz > Subject: Re: [Exist-open] Paging on sorted sequences > > > Kai M=FCtz wrote: > > > is there a best practice to implement paging with XQuery/eXist? I.e. = is > > there a possibility to get the first 20 items of a sorted sequence ot= her > > than using subsequence or similar expressions on the entire sequence? > > Performance is very important. > > In my experience with this problem, speed of retrieval of a subsequence > isn't really an issue, especially if the results are cached and then > retrieved by subsequent operations on the cache (i.e. on an array of > pointers, not on the data to which they point) each time a new page is > requested. It's getting the result sequence sorted in the first > place that's > so costly, and in many situations that sort has to be performed up fron= t > because it's the basis of the page grouping. I have found this a major > obstacle to using eXist (or any other XQuery implementation I > have tried) in > any application where paged presentation of large sorted datasets > is of the > essence. > > Michael Beddow > > > -----------------------------------------------------------------------= -- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open |