[MarkLogic Dev General] sorting efficiency question
Charles Blair
chas at uchicago.edu
Fri Dec 15 19:13:56 PST 2006
hello all. i need to do a 3-level sort, somewhat as follows:
let $docs := for $i in fn:distinct-values($results//titleName),
$j in fn:distinct-values($results//titleTypeName),
$k in fn:distinct-values($results//titlePhotoSequenceNumber)
let $p := $results[//titleName = $i and
//titleTypeName = $j and
//titlePhotoSequenceNumber = $k]
order by $i, $j, $k
return $p
the above works, and is easy enough to write, but it's not terribly
speedy at returning results. does someone have, or can someone
suggest, a better approach?
thanks.
More information about the General
mailing list