Hello all,

 

I’m scanning millions of XML records imported from CSV looking for instances of ‘bib_rec_id’ which are non-numeric. Which of these two is if-statements likely to complete earlier?

 

for $a in (/csv/record/bib_rec_id)

  return

    if ($a castable as xs:integer) then … blah

 

or

   

   if (matches($a, '^[0-9]+$')) then … blah

 

 

Yes – I’m trying it out now, but I suspect it will be quicker to ask than wait for either query to complete.

 

TIA.



Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The Netherlands, Registration No. 33156677, Registered in The Netherlands.