RUBY-790 Allow count to work with query hints