https://db.cs.cmu.edu/papers/2016/yu-sigmod2016.pdf
Section 3.4 of this paper covers another example of this.