SQL Engine - Query Optimizer (Query Optimization) in Stream
A query in a stream is called a pipeline
If you're joining a stream to a table, and the table is small, then you can use a map join (aka a hash join with a small “build” side). But joining two streams is very different to joining two tables.
stream1 join history-of-stream2
union
history-of-stream2 join stream2