Changes towards eliminating materialization of Ids from subqueries