Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: XML parsing - huge file strategy?

by pc88mxer (Vicar)
on Jul 18, 2008 at 14:43 UTC ( [id://698636]=note: print w/replies, xml ) Need Help??


in reply to XML parsing - huge file strategy?

Could I read it in a line at a time, look for the appropriate start/stop tags and parse it that way?
If your XML is formatted in a manner which is conducive to line-by-line parsing then it shouldn't be a problem.

Alternatively, if your database dump is just a sequence of one kind of element, this should also work:

open(XML, "<", ...); { local($/) = '</record>'; while (<XML>) { ...process one <record> element... } }

With regard to why your experiment on the 400M record table is taking so long... are you grabbing 1M records at a time by using a LIMIT clause (i.e. LIMIT n, 1000000)? If you have any index on that table (say on column colX), adding ORDER BY colX should help speed things along.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://698636]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-26 08:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found