ensuring count queries use postgres index rather than full scan by changing COUNT("npis".*) to COUNT(*)