This table: sysschedules
If the freq_type is 8 (weekly) then freq_interval is 1,2,4,8,16,32,64 for Su,M,T,W,Th,F,S.
But when freq_type is 32 (monthly relative) then freq_interval is 1,2,3,4,5,6,7,8,9,10 for Su,M,T,W,Th,F,S, weekday, weekend.
Why is this? Is there some sort of calculation occurring to reduce query complexity?
If so, how? (sry if I sound clueless, building a recurring events system is melting my brain)
If
freq_typeis 8, then the job can occur on one or more days – so there needs to be a way to represent multiple days in thefreq_intervalcolumn. This is done by assigning each day a power of two value, and so multiple values can be added together unambiguously. E.g. for something that occurs on Monday, Wednesday and Friday, the value would be 2+8+32 = 42. (Your question has the wrong values assigned to the days)If
freq_typeis 32, then only a single option can be selected – one day of the week, or day, weekday or weekend. Since multiple values cannot be combined, a simpler representation can be used.