Adds indexing benchmarks.

Adds the logical and explicit indexing benchmarks described in #5008.