[ https://issues.apache.org/jira/browse/CALCITE-4290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17211430#comment-17211430 ]
Haisheng Yuan commented on CALCITE-4290: ---------------------------------------- The cost model doesn't take column width into account, so it is possible that the less optimal plan has the same cost with the expected column pruning plan, but this is just a speculation. It might be better to attach a test case, so whoever interested in this issue can work on it. > Not optimal subqueries due to a "*" in them > ------------------------------------------- > > Key: CALCITE-4290 > URL: https://issues.apache.org/jira/browse/CALCITE-4290 > Project: Calcite > Issue Type: Bug > Components: jdbc-adapter > Affects Versions: 1.25.0 > Reporter: Roman Churganov > Priority: Major > > Run a query which should be distributed into sub-queries onto multiple > schemas through JDBC adapter, for example > select ft.id, ft.c11, tt.c41 from sch1.foo ft join sch2.tab tt on > ft.id = tt.id > Calcite will make two sub-queries like SELECT * FROM "TAB" ORDER BY "ID" and > SELECT * FROM "FOO" ORDER BY "ID" which are not optimal due to an excessive > columns data requested > -- This message was sent by Atlassian Jira (v8.3.4#803005)