kunikos
BAN USERYou can cache the computed values from the MapReduce job just fine. Add Redis or Memcached to your architecture to distribute query load for previous runs, recompute the cache values on interval (the problem requires 24 hrs, so daily would be a starting point-- or perhaps hourly for a rolling 24 hrs)
- kunikos January 01, 2013If you want to have all of the employees in the results, despite missing department and region data then you need to use OUTER joins:
SELECT r.RegnName as 'Region', d.DeptName as 'Dept', e.EmpID as 'Id', e.EmpName as 'Name', e.Salary
FROM Employee e
LEFT OUTER JOIN Department d ON e.EmpID = d.EmpID
LEFT OUTER JOIN Region r ON d.DeptID = r.DeptID
ORDER BY r.RegnName, d.DeptName
Results from sample data:
KL, 'CSE', 101, 'Karthik', 10000
NULL, NULL, 102, 'Amir', 15000
Wikipedia entry on Fisher-Yates shuffle:
- kunikos January 01, 2013"For example, the built-in pseudorandom number generator provided by many programming languages and/or libraries may often have only 32 bits of internal state, which means it can only produce 232 different sequences of numbers. If such a generator is used to shuffle a deck of 52 playing cards, it can only ever produce a very small fraction of the 52! ≈ 2225.6 possible permutations. It's impossible for a generator with less than 226 bits of internal state to produce all the possible permutations of a 52-card deck. It has been suggested[citation needed] that confidence that the shuffle is unbiased can only be attained with a generator with more than about 250 bits of state."