Make fast query with "count(*)" instead selecting all data