Performance improvements

Added the singular option to prevent the use of the nested subquery when generating an iterator.