Jump to content

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


wbeck

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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...