ByIdIterator should use visibility aware typeId when constructing SQL queries.
Merge branch 'release/2.1' into release/2.2