Hi everyone, I'm working with a bit large database and optimizations but I'm having problems when I need to merge the results of my optimization with my data.
I have a matrix of results A (9000x3) where the column 1 has an id. I have a matrix from my data B (600000x2) where the id is in column 1 as well. The id in A is unique but not in B. What is more not every id of B is on A. What i'm looking for is a matrix C (600000x4) when I merge the data from matrix A to matrix B.
I'm using the code attached which sort both A and B, then for the when i find the interception i star the merging and at the end for those id which i don't find in A i give the value of zero. The process takes arnd 7 minutes, which is much longer that the same process running in Stata for example.
Does anyone knows a more efficient way to merge data?
Thanks in advance
Attachment: mergeWithMpio.nb, URL: ,