DataBrewery/cubes — pull request #242 by srobertson (2014-11-20 01:25:02+00:00)
Title: added 'partition' attribute to store

Due to the size of our datasets we make heavy use of MySQL partitions.

MySQL partitions require that the partition key be present in every query.

This patch lets you specify

```
[store]
partition: some_column_name
```

If it's present it adds an extra equi join condition from the fact table to each dimension that's equivalent to this:

```sql
FROM
fact_table
INNER JOIN fact_table ON (
fact_table.dimension_id = dimension_table.id
AND fact_table.partition = dimension.partition
)
```

Which is enough to take advantage of the partitions.

I consider this to be more of a demonstration/proof of concept than anything else as more flexible option would be to extend the mapper to allow joining on multiple columns.