ByIdIterator should use visibility aware typeId when constructing SQL queries.