Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

planner: plan union, union all #421

Open
skyzh opened this issue Oct 6, 2022 · 2 comments
Open

planner: plan union, union all #421

skyzh opened this issue Oct 6, 2022 · 2 comments

Comments

@skyzh
Copy link
Member

skyzh commented Oct 6, 2022

No description provided.

@skyzh skyzh changed the title planner: plan union, union all, intersect, intersect all planner: plan union, union all Oct 6, 2022
@skyzh
Copy link
Member Author

skyzh commented Oct 6, 2022

removed intersect, intersect all because it require semi join for optimal performance.

@skyzh
Copy link
Member Author

skyzh commented Oct 6, 2022

D create table t1(v1 int);
D create table t2(v2 int);
D explain select * from t1 intersect select * from t2;

┌─────────────────────────────┐
│┌───────────────────────────┐│
││       Physical Plan       ││
│└───────────────────────────┘│
└─────────────────────────────┘
┌───────────────────────────┐
│       HASH_GROUP_BY       │
│   ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─   │
│             #0            │
└─────────────┬─────────────┘
┌─────────────┴─────────────┐
│         PROJECTION        │
│   ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─   │
│             #0            │
└─────────────┬─────────────┘
┌─────────────┴─────────────┐
│         HASH_JOIN         │
│   ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─   │
│            SEMI           │
│ #0 IS NOT DISTINCT FROM #0├──────────────┐
│       EC = 0.000000       │              │
│      COST = 0.000000      │              │
└─────────────┬─────────────┘              │
┌─────────────┴─────────────┐┌─────────────┴─────────────┐
│          SEQ_SCAN         ││          SEQ_SCAN         │
│   ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─   ││   ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─   │
│             t1            ││             t2            │
│   ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─   ││   ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─   │
│             v1            ││             v2            │
│            EC=0           ││            EC=0           │
└───────────────────────────┘└───────────────────────────┘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant