Use segment ordinals as global ordinals if possible

Use segment ordinals as global ordinals if a segment contains all values for a field on a shard level.

PR for #5854