Each job can be described with the number of parameters - job sphere, job name, salary and so on. Each parameter has set of predefined values -
- Job sphere - IT,medicine,industry...
- Job name - programmer, tester, driver...
- 10-50 thousands per month, 50-100...
- Flexy time, full time, freelance...
Let's encode saved search. Maximal number of values among all parameters (I believe it is job name) is the base of numeral system. Number of parameters - number of digits.
BIGINT = 2^64-1 = 18 446 744 073 709 551 616 = 20 digits
. In normal 10-base system you can describe 20-1 (first digit is fixed) = 19
parameters each having 10 values. As 10 values is not enough for describing such parameter as job name you should use 30-60-base system. Of course, it leads to decreasing total number of parameters, but I thing it's possible to describe some job with 12-15 parameters.
Create table savedSearches(code,mail)
which indexed on (code,mail). Index type - primary key.
New job posted:
1) Encode it programatically.
2) select mail from savedSearhes where code=calculatedCode
. Mail is in covered index - select sholuld fast enough.
3) Send new job to selected mails.
Important note - one parameter - host company of posted job can have too much values. I think you should store it separately, not in savedSearhes table as user usually don't care about company - he cares about salary, skills e.t.c.
If user wants to search not fixed parameter, for instance not just programmer position but tester, team leader you have to search not single encoded number but interval.
My idea is just assumption, some base for further investigations))