ranking recently completed todos only for mysql and postgresql