Excerpt | ||
---|---|---|
| ||
Siddhi Wiki for patitions |
...
Following example shows a sample partition definition;
Defining a partition with an ID 'StockSymbol' which will partition any query that uses this particular partition definition by the 'symbol' attribute of 'stockStream' .
define partition StockSymbol by stockStream.symbol ;
...
Following example shows a sample definition for range partitioning.
Defining a partition with an ID 'StockVolume' which will partition any query that uses this particular partition definition by the range definitions;
namely if volume is less than 10 it will be sent to the partition 'SMALL', if it is between 10 and 100, then it would be sent to 'MEDIUM' partition, else
it would go to partition identified by key 'LARGE'.
define partition StockVolume by
range volume < 10 as 'SMALL',
range volume >= 10 && and volume <= 100 as 'MEDIUM',
range volume > 100 as 'LARGE' ;
...