
miller
User
May 23, 2011, 2:12 PM
Post #2 of 2
(329 views)
|
|
Re: [sam001] Key value columns to table format
[In reply to]
|
Can't Post
|
|
Have you bothered to do any benchmarking using Time::HiRes->gettimeofday to determine what's exactly taking up all the time. I suspect that it's probably the inserting into the new table. If this is the case, then maybe it's an issue of a database index having to be updated for every insert. if THIS is the case too, then you can either group your insert statements into one huge operation, or you can even drop whatever index is causing the problems and recreate it after you do all of your inserts. Either way, you need to do some profiling before you can know how to improve your queries. Also note, it would be possible to increase your original selection queries by using a left join instead of doing an individual query for each SN. However, I actually doubt that the selecting is a significant draw on the time. - Miller PS, I've attached a slightly cleaned up version of your perl code in case you need further assistance.
(This post was edited by miller on May 23, 2011, 2:13 PM)
|