News for hackers. Stuff that matters.
Re:Query Engines: Push vs. Pull by Ericson2314 on Saturday May 01, 2021 @02:41PM (#27008670)
The truth is you need almost everything to do push and pull. Just as pull alone does "forks" inefficiently, push alone does "joins" inefficiently.

People shy away from this conclusion because doing everything both ways is quite hard and requires fancier abstractions to make nice than people are familiar with.

Re:Query Engines: Push vs. Pull by scott0129 on Saturday May 01, 2021 @03:11PM (#27008941)
> The truth is you need almost everything to do push and pull. Just as pull alone does "forks" inefficiently, push alone does "joins" inefficiently.

That's really is a simple and intuitive summary. Thank you for that insight!

Re:Query Engines: Push vs. Pull by Ericson2314 on Saturday May 01, 2021 @10:34PM (#27011892)
Thanks, glad to share it!
Re:Query Engines: Push vs. Pull by jadbox on Saturday May 01, 2021 @08:54PM (#27011378)
This is exactly why data patterns like Observables (https://github.com/tc39/proposal-observable) and ReactiveX (http://reactivex.io/) are so powerful. You can design your interface to be subjective to both. :)
Re:Query Engines: Push vs. Pull by btown on Sunday May 02, 2021 @12:39AM (#27012401)
It's a bit more complicated than this, because Observables in both frameworks are only required to implement push-style interfaces (that's the public interface of event listeners by design), and if a consumer wishes to pull at its own rate from an arbitrary source, the only general solution is to create an infinite buffer that materializes the pusher's outputs, which is the exact performance tradeoff described in the (excellent) OP article.

http://reactivex.io/documentation/operators/backpressure.htm... describes ReactiveX's approach to the problem in great detail. To quote the section that essentially reaches the same conclusion as the grandparent post pointing out how "forks" (using the same pull-style data source twice) inherently require buffering/materialization or sampling:

> When a cold Observable is multicast (when it is converted into a connectable Observable and its Connect method is called), it effectively becomes hot and for the purposes of backpressure and flow-control it should be treated as a hot Observable. Cold Observables are ideal for the reactive pull model of backpressure implemented by some implementations of ReactiveX (which is described elsewhere). Hot Observables typically do not cope well with a reactive pull model, and are better candidates for other flow control strategies, such as the use of the operators described on this page, or operators like Buffer, Sample, Debounce, or Window.

There are great visuals if you expand the RxJS examples in the link above.

Re:Query Engines: Push vs. Pull by kjeetgill on Saturday May 01, 2021 @09:49PM (#27011694)
Mind explaining the fork vs joins inefficiency thing a bit further?

I feel like there's some wisdom here, but I don't think I grocked it

Re:Query Engines: Push vs. Pull by Ericson2314 on Saturday May 01, 2021 @10:33PM (#27011890)
With forks (in the article DAGs vs trees), pure pulling means you pull the same thing twice.

With joins, pushing only works if both sides push at the same time.

In general, joins work by a push on one side triggering a pull on the other side, and then both are combined.

For forks there should be some subscribe mechanism to turn pulls into pushes that can cheaply fan out to all subscribers.

(Side note, the mitigations ought to be completely symmetric. This is a sign there is more to the problem that I am missing.)

Re:Query Engines: Push vs. Pull by quantified on Tuesday May 04, 2021 @01:17AM (#27034282)
I believe joins work without simultaneous pushing. One side can build first, the other side can probe in a pushed fashion after but not necessarily simultaneously.

“Trigger” is not necessarily the relationship, between build and probe sides though it could be. The DAG paths that produce/push the probe can be triggered by the completion of the build. “Happens after” is more strictly apt.

Re:Query Engines: Push vs. Pull by Quekid5 on Saturday May 01, 2021 @05:40PM (#27010125)
People have been vacillating on this forever and the truth is... (drum roll) It depends.