query_count fix in case of big size of item data

When table items size bigger than 1M, query_count returns wrong count. It returns count of items for the first data page only.
We need query all pages to receive correct items count.