i'm probably missing something. but in the following query, i don't understand why SIP isn't pushed-down past union all into the two scans. SIP is pl at the union operator which causes a full table scan on foo and bar.
create table foo (x int not null, primary key(x));
insert into foo values(1);
create table bar (x int not null, primary key(x));
insert into bar values(3);
create table ace (x int not null, y int not null, primary key(x));
insert into ace values(5,5);
explain select f.x from (
select * from foo
union all
select * from bar
) f, ace a
where f.x = a.x
and a.y = 1;
Access Path: +-JOIN HASH [Cost: 8, Rows: 2 (NO STATISTICS)] (PATH ID: 1) Outer (LOCAL ROUND ROBIN)
| Join Cond: (f.x = a.x)
| Execute on: All Nodes
| +-- Outer -> SELECT [Cost: 4, Rows: 4 (NO STATISTICS)] (PATH ID: 2)
| | Execute on: All Nodes
| | +---> UNION ALL [Cost: 4, Rows: 4 (NO STATISTICS)] (PATH ID: 3)
| | | Execute on: All Nodes
| | | Runtime Filter: (SIP1(HashJoin): f.x)
| | | Execute on: All Nodes
| | | +---> STORAGE ACCESS for foo [Cost: 2, Rows: 2 (NO STATISTICS)] (PATH ID: 5)
| | | | Projection: public.foo_b0
| | | | Materialize: foo.x
| | | | Execute on: All Nodes
| | | +---> STORAGE ACCESS for bar [Cost: 2, Rows: 2 (NO STATISTICS)] (PATH ID: 7)
| | | | Projection: public.bar_b0
| | | | Materialize: bar.x
| | | | Execute on: All Nodes
| +-- Inner -> STORAGE ACCESS for a [Cost: 3, Rows: 1 (NO STATISTICS)] (PATH ID: 8)
| | Projection: public.ace_b0
| | Materialize: a.x
| | Filter: (a.y = 1)
| | Execute on: All Nodes
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
