Hi Constantine,
Incidentally, BaseX is simply unbelievably fast at executing this – a million fragments clustered and written out to another DB in 16 seconds on a laptop. My congratulations on an amazing product.
Thanks!
If I use the entire XML fragment as a grouping key, something like this: [...] … then will the grouping be equivalent to the functionality of the deep-equal function?
A grouping keys is the atomized value of a grouping variable [1,2]. If this value is prone to be ambiguous, you can create an arbitrary other value, e.g. as follows:
group by $val := string-join($a/*, '; ')
Cheers, Christian
[1] http://docs.basex.org/wiki/XQuery_3.0#group_by [2] http://www.w3.org/TR/xquery-30/#id-group-by