Trino Merge query scanning complete target table. #23441
-
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 4 replies
-
Dynamic filtering requires a RIGHT JOIN. In this case the CBO is picking LEFT JOIN because the target table is small enough to be broadcast as the build side of a LEFT JOIN. |
Beta Was this translation helpful? Give feedback.
-
Hey @raunaqmorarka I have tried the config you provided, also tried it with a larger table too. Even with right join the whole target table is getting scanned. Can you please help me. Any help would be appreciated ! |
Beta Was this translation helpful? Give feedback.
-
Can you share output of EXPLAIN ANALYZE with right join ? |
Beta Was this translation helpful? Give feedback.
-
Here are all the details @raunaqmorarka
20 rows getting scanned from the target table even thought the source table just had 1 row. So according to dynamic filtering only a single row should have been scanned. EXPLAIN TYPE(LOGICAL )
EXPLAIN ANALYZE
|
Beta Was this translation helpful? Give feedback.
-
Hey @raunaqmorarka any follow up on this, would be really appreciated ! |
Beta Was this translation helpful? Give feedback.
-
For small data sets like that the query will finish too quickly for dynamic filtering to have an effect. |
Beta Was this translation helpful? Give feedback.
For small data sets like that the query will finish too quickly for dynamic filtering to have an effect.
Try setting
iceberg.dynamic-filtering.wait-timeout=10s