Skip to content

Instantly share code, notes, and snippets.

@benesch
Created January 28, 2020 04:44
Show Gist options
  • Select an option

  • Save benesch/627d227cd66218aa9c00a17f775a9e65 to your computer and use it in GitHub Desktop.

Select an option

Save benesch/627d227cd66218aa9c00a17f775a9e65 to your computer and use it in GitHub Desktop.
Let {
l5 = Distinct {
group_key: [#3],
Get { materialize.public.tab0 (u1) }
}
} in
Let {
l9 = Reduce {
group_key: [#0],
aggregates: [any(#0 = #2)],
Join {
variables: [],
Get { l5 },
Get { materialize.public.tab0 (u1) }
}
}
} in
Let {
l10 = Union {
Get { l9 },
Map {
scalars: [false],
Union {
Project { outputs: [0], Negate { Get { l9 } } },
Get { l5 }
}
}
}
} in
Let {
l11 = Join {
variables: [[(0, 3), (1, 0)]],
Get { materialize.public.tab0 (u1) },
Union {
Get { l10 },
Map {
scalars: [null],
Union {
Negate { Distinct { group_key: [#0], Get { l10 } } },
Get { l5 }
}
}
}
}
} in
Let { l12 = Distinct { group_key: [#1], Get { l11 } } } in
Let {
l16 = Join {
variables: [],
Get { l12 },
Get { materialize.public.tab0 (u1) }
}
} in
Let {
l23 = Reduce {
group_key: [#0],
aggregates: [any(#0 = #4)],
Join {
variables: [[(0, 3), (1, 0)]],
Get { l16 },
Reduce {
group_key: [#4],
aggregates: [any(true)],
Join {
variables: [[(0, 1), (1, 0)]],
Filter {
predicates: [!isnull #1],
Get { materialize.public.tab0 (u1) }
},
Distinct {
group_key: [#3],
Filter { predicates: [!isnull #3], Get { l16 } }
}
}
}
}
}
} in
Let {
l24 = Union {
Get { l23 },
Map {
scalars: [false],
Union {
Project { outputs: [0], Negate { Get { l23 } } },
Get { l12 }
}
}
}
} in
Project {
outputs: [0],
Filter {
predicates: [#5 || #7],
Join {
variables: [[(0, 1), (1, 0)]],
Get { l11 },
Union {
Get { l24 },
Map {
scalars: [null],
Union {
Negate { Distinct { group_key: [#0], Get { l24 } } },
Get { l12 }
}
}
}
}
}
}
Let {
l5 = Distinct {
group_key: [#3],
Get { materialize.public.tab0 (u1) }
}
} in
Let {
l9 = Reduce {
group_key: [#0],
aggregates: [any(#0 = #2)],
Join {
variables: [],
Get { l5 },
Get { materialize.public.tab0 (u1) }
}
}
} in
Let {
l10 = Union {
Get { l9 },
Map {
scalars: [false],
Union {
Project { outputs: [0], Negate { Get { l9 } } },
Get { l5 }
}
}
}
} in
Let {
l11 = Join {
variables: [[(0, 3), (1, 0)]],
Get { materialize.public.tab0 (u1) },
Union {
Get { l10 },
Map {
scalars: [null],
Union {
Negate { Distinct { group_key: [#0], Get { l10 } } },
Get { l5 }
}
}
}
}
} in
Let { l12 = Distinct { group_key: [#1], Get { l11 } } } in
Let {
l16 = Join {
variables: [],
Get { l12 },
Get { materialize.public.tab0 (u1) }
}
} in
Let {
l23 = Reduce {
group_key: [#0],
aggregates: [any(#0 = #4)],
Join {
variables: [[(0, 2), (1, 0)]],
Get { l16 },
Reduce {
group_key: [#4],
aggregates: [any(true)],
Join {
variables: [[(0, 1), (1, 0)]],
Filter {
predicates: [!isnull #1],
Get { materialize.public.tab0 (u1) }
},
Distinct {
group_key: [#2],
Filter { predicates: [!isnull #2], Get { l16 } }
}
}
}
}
}
} in
Let {
l24 = Union {
Get { l23 },
Map {
scalars: [false],
Union {
Project { outputs: [0], Negate { Get { l23 } } },
Get { l12 }
}
}
}
} in
Project {
outputs: [0, 8],
Map {
scalars: [#5 || #7],
Join {
variables: [[(0, 1), (1, 0)]],
Get { l11 },
Union {
Get { l24 },
Map {
scalars: [null],
Union {
Negate { Distinct { group_key: [#0], Get { l24 } } },
Get { l12 }
}
}
}
}
}
}
--- bad 2020-01-27 23:44:01.000000000 -0500
+++ good 2020-01-27 23:44:04.000000000 -0500
@@ -56,7 +56,7 @@
group_key: [#0],
aggregates: [any(#0 = #4)],
Join {
- variables: [[(0, 3), (1, 0)]],
+ variables: [[(0, 2), (1, 0)]],
Get { l16 },
Reduce {
group_key: [#4],
@@ -68,8 +68,8 @@
Get { materialize.public.tab0 (u1) }
},
Distinct {
- group_key: [#3],
- Filter { predicates: [!isnull #3], Get { l16 } }
+ group_key: [#2],
+ Filter { predicates: [!isnull #2], Get { l16 } }
}
}
}
@@ -89,9 +89,9 @@
}
} in
Project {
- outputs: [0],
- Filter {
- predicates: [#5 || #7],
+ outputs: [0, 8],
+ Map {
+ scalars: [#5 || #7],
Join {
variables: [[(0, 1), (1, 0)]],
Get { l11 },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment