Limit context count to primary key

Note, distinct is applied internally to apply().

Signed-off-by: Byron Ruth <b@devel.io>