Remove unnecessary SELECT COUNT(*) database query and add an option so skip the other one
Improve endless flag handling
Merge pull request #4 from 10clouds/dbl-count

Deal with redundant SELECT COUNT(*), add an option to not compute count at all