spaces: Use COUNT_MAX instead of COUNT_ALL