Add count support for primary key

This will be *much* more performant than pulling the whole key set into
memory and counting it!