Hello! I am a beginner programmer. I have a problem with the runtime of one of my applications.
I have a website application that tries to compute for recommended objects to users. The recommended results is based on the user as well as the currently viewed object.
My problem is, I have 500 objects and almost 30 users. What I do is, for each user, I compute the value for recommendation for EACH artwork. So that means, for 1 object, I compare ALL of the other objects to it. Then after the computation, I store it in the Database. So for each user, I have around 250000 records inside the Database.
Can I have any tips regarding on how to optimize it? Either some changes to the Database model or some changes to the code. I have 3 FOR loops (1 for user, 1 for viewed object, 1 for target objects). I have already tried using UNION ALL, but the INSERT statements doesn't seem to be the case.
Help please!
Well your math I believe is wrong, I think its closer to 75,000 maybe in your tests you forgot to delete a few things, if you just completed some tests it might be the only reason its going slow now since I think sql can handle 75,000 in a very decent time.
If you posted your code we could have a better idea of how to help you out on this one.
This is going to depend HEAVILY on how you are computing these values. It looks like you're dealing with a typical space/time trade off in efficiency, however. You can compute everything once and store the results, or compute everything on the fly each time.
Also, in many instances 250,000 records is not much data. Is there a way to get the object-object data to be user independent?
Is there any possibility we can see your code? It could help out some.
Programmer (n): An organism that can turn caffeine into code.
Programming would be so much easier without all the users.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks