Very similar code to `RadixJoin::determineDynamicCount`!