Sum by key test

proves that my hair-brained optimization was broken and reverts.