Jump to content

Figured Out Issue From Last Post, BUT Processing Time On Full Job Takes Forever

Recommended Posts

Ok, so the long post didn't go over too well with anybody, fortunately I've figured out A solution on my own... Ish. If someone could give me a nudge in the right direction I'd be eternally grateful! If anyone wants to look at the structure of what I'm dealing with, it's in my previous post from a few days ago. So the following { let $doc := . for $v in $doc//root/Row, $t in $doc//root/Row/tracknumber/text() where matches($t, 'THIS IS THE UPC-01') and $v/tracknumber/text() = $t return $v/UPC/text() } Will do what I want. If I make a single field that combines the UPC and track number that will work as a unique identifier, and can be done in bulk in source spreadsheet. It will return the value if the field exists, and nothing if it doesn't. I even figured out a way to have it generate the XML tags around the value in the eventuality that the track exists via { let $doc := . for $v in $doc//root/Row, $t in $doc//root/Row/tracknumber/text() where matches($t, 'THIS IS THE UPC-01') and $v/tracknumber/text() = $t return'</ISRC> </SoundRecordingId> <ResourceReference>A29</ResourceReference> <ReferenceTitle> <TitleText>' } I can't get it to leave the < and > in doing it that way, but a simple find/replace fixes that right up. If there's a way to keep the brackets it would be cool to know though :) In any event, I've basically solved all my issues for generating a complete valid XML doc with only fields that need to exist. Except when I run it on my full Spreadsheet converted to XML it chokes. Works great on a test source doc with 3 albums, does it in 1.6 seconds. However when I have the full 3000+ song XML doc I never let it run long enough to finish, as overnight seemed like more than enough time to generate a single albums worth of XML. I've noticed that processing time seems to go up exponentially as the number of tracks goes up At ~400 it's 188 seconds, at ~800 it's 677 seconds, etc. It would seem to me this SHOULD be a linear increase in processing time. Like 3000 tracks being processed SHOULD be about 145 seconds judging from my test setup. I'm sure it's some nuance of the code and how Xquery processes things. So if someone could show me a way to set this up where it will be able to run through things a bit faster that would be amazing. Otherwise I'm going to need to create several shorted source documents to run the query on, which will be a bit of a nusance... And I'd just like to figure out why I'm having the problem for future reference. Thank you in advance for your help!!!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...