| Yiping's profileYiping's spaceBlog | Help |
|
October 20 Use your computer smartlyWe always feel our laptop can open a file it in seconds. Yet as the FYP goes on, we suddenly find sometimes the file is so large or the calculation is so complex that waiting become necessary. But trust me, our small laptop can still handle most of the cases. It’s just that you have to choice the right tool. Last night, a friend ask me to make a C++ program because her Perl script has been running forever. The task is easily understood: inner product of two tables. The bottleneck is that one of the table contains 40,000 records and she was using a n^2 complexity method (search the whole table for each match). I don’t want to look at the Perl script or code a C++ during such a relaxing night because the first idea came into my mind is SQL. Yes, it is nature to do this in SQL. I host Microsoft SQL 2008 Express on my old T43 so I just import the two tables then do the simple query:
No doubt the database engine was highly optimized for doing such things and the whole process was finished in 6 min. Comments (5)
TrackbacksThe trackback URL for this entry is: http://kookaburracc.spaces.live.com/blog/cns!76D91D7030633430!2611.trak Weblogs that reference this entry
|
|
|