Pass down projection information
Eulerizeit opened this issue · 3 comments
This is a subset of issue #13
We closed the scan cols patch in Postgres this is an issue that when finished will replace that patch with, most likely, several patches.
Included in the patch set will be:
- extracting columns for scans -- this is before the table AM before or during the plan
- extracting columns for returning -- this is before the table AM before or during the plan
- TableAM modifications for passing columns for scan (index and sequential)
- TableAM modifications for passing columns for operations where we fetch a row by TID (returning, insert on conflict, etc.)
- TableAM modifications for passing columns for operations where we lock a tuple
Effectively this should be decoupling the ingrained assumptions that a 'row' is the atomic thing being grabbed.
From a previous investigation on improvements for scan:
Column store layout can be leveraged to scan only subset of columns from table which are requied to perform the task. Following functions don't need to pull full tuple but can be optimized to only get required subset of columns.
Sequential Scan to leverage column projections
- check_default_partition_contents()
- CopyTo()
- validateCheckConstraint()
- validateForeignKeyConstraint()
Index Scans to leverage column projections
- table_index_fetch_tuple_check()
- unique_key_recheck()
- check_exclusion_or_unique_constraint()
- IndexNextWithReorder()
- get_actual_variable_range()
&&
@ashwinstar modified following functions to leverage column projections.
- check_default_partition_contents()
- CopyTo()
- validateCheckConstraint()
Rest mentioned above are still remaining.
ExecInitBitmapHeapScan()
should also pass down the projection list if possible.