twitter/gizzard — Issue #79: If gizzard support "Shard-Query" like feature?
Author: shawny
Created: 2011-12-28 04:12:54+00:00
State: open

Every SQL statements breaks down into a relational algebra equation. In Algebra you learn that some operations are “distributable”, that is, you can split them up into smaller units, and when you put those units back together the result is the same as if you didn’t take it apart. Projection, GROUP BY, SUM, COUNT, MIN*, and MAX* are distributable. With a little elbow grease, all non-distributable aggregate functions (AVG,STDDEV,VARIANCE, etc) can be decomposed into distributable functions using simple substitution rules.