A SelectionVectorRemover is often used after a filter, to copy into a newly allocated new batch only the "filtered out" rows. In some cases the columns used by the filter are not needed downstream; currently these columns are being needlessly allocated and copied, and later removed by a Project.
Suggested improvement: The planner can pass the information about these columns to the SelectionVectorRemover, which would avoid this useless allocation and copy. The Planner would also eliminate that Project from the plan.
Here is an example, the query:
And the result plan (trimmed for readability), where "l_orderkey" and "l_shipmode" are removed by the Project:
The implementation will not be simple, as the relevant code (e.g., GenericSV2Copier) has no idea of specific columns.