[xquery-talk] Collections - family relationships
msokolov at safaribooksonline.com
Mon Jan 6 04:43:06 PST 2014
On 1/6/2014 7:21 AM, Andrew Welch wrote:
> On 6 January 2014 12:07, Ihe Onwuka <ihe.onwuka at gmail.com> wrote:
>> Thank you. I'm not wishing to sound uncharitable or rude, but I deliberately
>> didn't ask for a solution because I wanted to focus on the original
> The non-specific general approach to this problem is grouping...
>> Consider the use case in the context of someone who did not have access to
>> XQuery 3.0.
> You will have the fun of XQuery 1.0 grouping then : ) or of course
> vendor extensions, which from my XQuery days were 90% of the code
Just because they are vendor extensions doesn't mean they aren't the
"right" solution. Any database-oriented system should offer you a
mechanism for indexing on a value such as "the author of the document"
and then an efficient means to return the keys of your index, either in
sorted order, or ordered by number of occurrences of (documents having)
the key. This is a specific kind of grouping, sometimes called
faceting. Once you have the values that occur once, the index should be
able to return the matching documents quickly, too.
Maybe with XQuery 3 the grouping operator will give you access to these
mechanisms in a more idiomatic (vendor-neutral) way, but it is
definitely worth verifying that your optimizer is able to do that if you
are dealing with more than a handful of documents.
More information about the talk