optimize counting recordsTotal and recordsFiltered