Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Suppose that for every table we know it's affinity column. It is either PK or explicitly defined affinity column. Then we can analyze WHERE expressions related to the given tables to extract partition info. For JOINs we can compare affinity functions of two tables. If they are compatible, then we can "pass" partition information from one table to another. 

...

Apache Ignite supports only hash-based sharding, so partition could be extracted only from equality conditions.

Extracted partition is either concrete number, or query argument index. We will denote first type as "N" (e.g. 1, 2, 3), and second as ":N" (e.g. :1, :2, :3). 

Equality

Code Block
languagesql
titleExtracting partition from equality
linenumberstrue
SELECT * FROM emp WHERE emp.id=100


OR

TODO

IN

TODO

Ranges on integer types

TODO

AND

TODO

Subquery

TODO

OR

TODO

Merging Partition Info

...