get_sample_count in database class
use new function to speed up startup
Merge pull request #54 from deralexxx/speed_up_count

Speed up count