Code that perform secondary indexing.