You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "neilconway (via GitHub)" <gi...@apache.org> on 2026/04/06 00:45:49 UTC

[I] Optimize mark joins + EmptyRelation [datafusion]

neilconway opened a new issue, #21391:
URL: https://github.com/apache/datafusion/issues/21391

   ### Is your feature request related to a problem or challenge?
   
   ```
     SELECT * FROM t1
     WHERE EXISTS (SELECT 1 FROM t2 WHERE t2.id = t1.id AND 1=0)
        OR t1.flag = true;
   ```
   
   Yields
   ```
        +---------------+------------------------------------------------------------+
        | plan_type     | plan                                                       |
        +---------------+------------------------------------------------------------+
        | physical_plan | ┌───────────────────────────┐                              |
        |               | │         FilterExec        │                              |
        |               | │    --------------------   │                              |
        |               | │         predicate:        │                              |
        |               | │        mark OR flag       │                              |
        |               | └─────────────┬─────────────┘                              |
        |               | ┌─────────────┴─────────────┐                              |
        |               | │      RepartitionExec      │                              |
        |               | │    --------------------   │                              |
        |               | │ partition_count(in->out): │                              |
        |               | │          1 -> 16          │                              |
        |               | │                           │                              |
        |               | │    partitioning_scheme:   │                              |
        |               | │    RoundRobinBatch(16)    │                              |
        |               | └─────────────┬─────────────┘                              |
        |               | ┌─────────────┴─────────────┐                              |
        |               | │     NestedLoopJoinExec    │                              |
        |               | │    --------------------   ├──────────────┐               |
        |               | │    join_type: RightMark   │              │               |
        |               | └─────────────┬─────────────┘              │               |
        |               | ┌─────────────┴─────────────┐┌─────────────┴─────────────┐ |
        |               | │         EmptyExec         ││       DataSourceExec      │ |
        |               | │                           ││    --------------------   │ |
        |               | │                           ││         bytes: 264        │ |
        |               | │                           ││       format: memory      │ |
        |               | │                           ││          rows: 1          │ |
        |               | └───────────────────────────┘└───────────────────────────┘ |
        |               |                                                            |
        +---------------+------------------------------------------------------------+
   ```
   
   But we could skip the entire NLJ, similar to #21321 
   
   ### Describe the solution you'd like
   
   _No response_
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Optimize mark joins + EmptyRelation [datafusion]

Posted by "neilconway (via GitHub)" <gi...@apache.org>.
neilconway commented on issue #21391:
URL: https://github.com/apache/datafusion/issues/21391#issuecomment-4189842212

   take


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org