...
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).
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
SELECT * FROM emp WHERE emp.id=100 |
TODO
TODO
TODO
TODO
TODO
TODO
...