Comment why we still remove non IndexPath's when custom scan is off

pull/5140/head
Onur Tirtir 2021-07-26 17:15:35 +03:00
parent a87405b6ba
commit 453ac40725
1 changed files with 7 additions and 0 deletions

View File

@ -202,6 +202,13 @@ ColumnarSetRelPathlistHook(PlannerInfo *root, RelOptInfo *rel, Index rti,
* we only consider ColumnarScanPath's & IndexPath's. For this reason,
* we remove other paths and re-estimate IndexPath costs to make accurate
* comparisons between them.
*
* Even more, we might calculate an equal cost for a
* ColumnarCustomScan and a SeqPath if we are reading all columns
* of given table since we don't consider chunk group filtering
* when costing ColumnarCustomScan.
* In that case, if we don't remove SeqPath's, we might wrongly choose
* SeqPath thinking that its cost would be equal to ColumnarCustomScan.
*/
RemovePathsByPredicate(rel, IsNotIndexPath);
RecostColumnarPaths(root, rel, rte->relid);