1.1.1

Table Of Contents
You can colocate another table, "cities," using the command:
CREATE TABLE CITIES
(
CITY_ID INTEGER NOT NULL CONSTRAINT CITIES_PK Primary key,
CITY_NAME VARCHAR(24) NOT NULL,
COUNTRY VARCHAR(26) NOT NULL,
AIRPORT VARCHAR(3),
LANGUAGE VARCHAR(16),
COUNTRY_ISO_CODE CHAR(2) CONSTRAINT COUNTRIES_FK
REFERENCES COUNTRIES (COUNTRY_ISO_CODE)
) PARTITION BY COLUMN (COUNTRY_ISO_CODE)
COLOCATE WITH (COUNTRIES)
In this example, both "countries" and "cities" are partitioned using the COUNTRY_ISO_CODE column. Rows
with the same COUNTRY_ISO_CODE value are colocated on the same SQLFire members.
See the CREATE TABLE reference page for more information.
Making a Partitioned Table Highly Available
Use the REDUNDANCY clause to specify a number of redundant copies of a table for each partition to maintain.
Because SQLFire is primarily a memory-based data management system, it is important to use redundancy when
necessary to enable fail-over if a member shuts down or fails. However, keep in mind that maintaining a large
number of redundant copies has an adverse impact on performance, network usage, and memory usage. A
REDUNDANCY value of 1 is recommended to maintain a secondary copy of the table data. For example:
CREATE TABLE COUNTRIES
(
COUNTRY VARCHAR(26) NOT NULL,
COUNTRY_ISO_CODE CHAR(2) NOT PRIMARY KEY,
REGION VARCHAR(26),
)
REDUNDANCY 1
SQLFire attempts to place copies of the same bucket onto hosts that have different IP addresses if possible, to
protect against machine failure. However, if there is only one machine available SQLFire places multiple copies
on that machine. Setting the enforce-unique-host boot property prevents SQLFire from ever placing
multiple copies on the same machine.
Set the redundancy-zone boot property to ensure that SQLFire places redundant copies on specic zones
that you dene. For example, to ensure that redundant copies are placed on different racks, set the redundancy-zone
for each machine to the logical name of the rack on which the machine runs.
See Conguration Properties on page 319.
If the primary and secondary buckets for a partition are unavailable, then queries to the table can fail. For a
persistent table, queries involving missing buckets fail with a PartitionOfflineException. Queries
across the entire table would also fail. Queries to non-persistent tables with missing partitions can return empty
results.
Limiting the Memory Consumption on a Member
Use the MAXPARTSIZE clause of the CREATE TABLE statement to load- balance partitioned data among the
available members.
The MAXPARTSIZE ClauseExample with BUCKETS, RECOVERYDELAY, and MAXPARTSIZE clause
species the maximum memory for any partition on a SQLFire member.
vFabric SQLFire User's Guide68
Managing Your Data in vFabric SQLFire