Update & Merge - scanning only required columns #29756
Unanswered
idosilverwater-vast
asked this question in
Q&A
Replies: 1 comment 1 reply
|
As far as I understand (might be completely making up stuff) the optimizer cannot optimize out the unneeded columns because they are referenced in the merge row. And therefore the Trino optimizer cannot safely remove them. In Maybe the |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
requesting help regarding implementation of
MERGEoperation in a trino connector.when executing
UPDATE <table> SET col2 = 5 where col3 = 2in a table with schema
col1:int, ..., col5:intthe engine plans and executes a scan with all the columns (and
rowidcolumn)although i'd expect only the
rowidandcol3to be scanned (and ifcol3=2's pushdown is supported then only forrowidto be scanned).I thought that maybe changing this behavior could be done through
beginMergebut that is only called afterapplyProjection/applyPredicate. And inapplyProjectionI might not have enough information to correctly drop columns.(I am using
RowChangeParadigm.CHANGE_ONLY_UPDATED_COLUMNSand returning in
getMergeRowIdColumnHandlea column handle that doesn't depend oncol1-5)Is there a standard way of implementing such a thing?
thank you
All reactions