The XQuery I have for performing the chunking is timing out after 9 minutes
(running in the query console). There are 156000 'rows' total in this
extract. I'm now reading the Developer's guide for Understanding
Transactions to figure out how I might optimize this query. My query
reads:
declare function local:random-hex($length as xs:integer) as xs:string {
string-join(
for $n in 1 to $length
return xdmp:integer-to-hex(xdmp:random(15)),
""
)
};
declare function local:generate-uuid-v4() as xs:string {
string-join(
(local:random-hex(8),local:random-hex(4),local:random-hex(4),local:random-hex(4),local:random-hex(12)),
"-"
)
};
for $row in /*/*/table_data/row
let $record := element {$row/../@name} {
for $field in $row/field[text()]
return element {$field/@name} {$field/text()}
}
return xdmp:document-insert(concat(
/*/*/@name,'/',name($record),'/',name($record),'_',local:generate-uuid-v4(),'.xml'),
$record);
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general