I would:
The tracking table should use video card ID.
Have only 1 cron job to update all prices every X minutes.
At the end of this job, check the prices for each GPU and compare to all the targets. Only send 1 email to each subscriber for all the subscriptions he has whose targets are met. Then unsubscribe that user from each subscribed GPU+target combination (delete the row).
Edit: to elaborate on the last part.
You probably have more users than GPUs.
- Select each GPU, currentPrice from the GPU table.
- Select each user from the UsersTrackingGPUs table where the target is >= GPU.currentPrice.
Keep track of what you're selecting so that you only send 1 email for each user regardless of how many tracked GPUs he matched. Something like:
discovered = { user1: [GPU1: $50, GPU2: $200], ... }
For each user in discovered:
Send 1 email with all matched GPUs.
For each matched user+GPU combination in discovered:
- Delete the row from UsersTrackingGPUs.
Apologies for the poor formatting, I'm not very proficient with this on mobile..
Edit again: more details.
Something like this: select * from UsersTrackingGPUs utg join GPU g on gtu.id=g.id group by utg.user_id having g.price <= utg.tracking_price
Sorry, I'm not going to get access to a PC for some time, but I think that should be close to what you need -- all users with all GPUs that they are tracking such that their track price is above the current price.
Hope that helps :-)