in reply to How to make my DBD::CSV DB code faster.
If you don't think you're ready for that (... aw c'mon! why not? well, anyway...) then you should consider changing from this approach:
to something like this:foreach row (id,hid,instance,etc...) in table1 lookup row in table2 that contains id,hid lookup a row in table3 that contains id,hid,instance
Since you're using DBD:CVS instead a real database server, I'm assuming that the amounts of data in table2 and table3 are small enough to fit comfortably in memory. If that's not true, then you really should think seriously about mysql or postgres.load all of table2 into a hash, keyed by "id,hid" load all of table3 into a hash, keyed by "id,hid,instance" foreach row (id,hid,instance,etc...) in table1 do something with row data, $table2{"id,hid"} and $table3{"id,hid,i +nstance"}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to make my DBD::CSV DB code faster.
by jZed (Prior) on Sep 30, 2005 at 02:47 UTC |