statistics.lua: Refactoring. Use one stored procedure instead of bunch of calls.