Do you know where your variables are? | |
PerlMonks |
Re: Data insert into DBby sundialsvc4 (Abbot) |
on Aug 10, 2011 at 16:37 UTC ( [id://919703]=note: print w/replies, xml ) | Need Help?? |
When you say fifty minutes for a mere 4,200 rows, then my first assumption would be that the script (which I have not inspected closely...) simply has a bug in it. When a database has “incredibly bad performance,” especially on inserts, updates and deletes, then you can pretty much hang your hat on the assumption that the system thinks that it has to commit to disk and verify every single disk-I/O operation that it is doing. (SQLite, for example, will do this unless told otherwise.) The trick, then, is to make sensible use of transactions. When a transaction is in progress, the DB knows that it can “lazy write.” Nevertheless, I agree with the earlier post: this looks merely like a job for “a bulk loader,” and there’s a plenty of those. I would be profoundly surprised if you actually had to “write a program” to do this at all.
In Section
Seekers of Perl Wisdom
|
|