Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize
<|>:
implementation of Tabulation
`Tabulation` has an instance of `AltTable`, which is intended to uphold the following law: ```haskell fromQuery a <|>: fromQuery b = fromQuery (a <|>: b) ``` The previous implementation was not actually defined in terms of `Query`'s `<|>:` (i.e., `UNION ALL`), because not every `Tabulation` can be safely `toQuery`'d. Instead it used a combination of `alignWith`, `catNonEmptyTable` and `some` that worked even on "magic" `Tabulation`s. However, using `unsafePeekQuery`, we can actually "statically" determine if a `Tabulation` is "magic" or not, which means we can selectively switch the implementation to use `Query`'s `<|>:` where possible. This produces a simpler and usually faster query.
- Loading branch information