This reverts the revert commit c8d73d93. It includes a fix for cases where we missed inserting VPValues for some selects, which should fix PR48142.