This is an old revision of the document!


Administration: Omnidex Fundamentals

Raw Data Files

Joining Tables

Omnidex allows joins between tables that point to raw data files. These are performed using standard SQL statements. Multiple types of table joins are allowed, including inner joins, outer joins and cross joins.

Table joins are often performed on columns that are referenced in primary and foreign key constraints. An Omnidex Environment against raw data files can include primary and foreign key constraints, just like an environment against a relational database. When these constraints are declared, Omnidex will honor the declared constraints, though it will not verify or enforce them.

When a raw data file has one or more columns that uniquely identify each row, they can be declared as a primary key. Omnidex will rely on primary key definitions, so do not declare a primary key unless it is truly unique.

Raw data files can also include foreign key constraints. Omnidex will also rely on foreign key definitions; however, it is also tolerant of minor errors in foreign key integrity. Raw data files often come from multiple suppliers, and the data may not exactly match. It is fine to declare a foreign key constraint in these situations as long as the differences are relatively minor. Note that errors in foreign key integrity may affect performance.

Omnidex requires that the datatypes of foreign keys match those of the corresponding primary key.

CREATE TABLE          "COUNTRIES"
 physical             "dat/countries.dat"
 (
  "COUNTRY"           CHARACTER(2),               
  "DESCRIPTION"       STRING(47),                
  "LATITUDE"          FLOAT                          usage "LATITUDE",
  "LONGITUDE"         FLOAT                          usage "LONGITUDE",
  "CAPITAL"           STRING(31),               
  "CAPITAL_LAT"       FLOAT                          usage "LATITUDE",
  "CAPITAL_LONG"      FLOAT                          usage "LONGITUDE",
  CONSTRAINT COUNTRIES_COUNTRY_PK PRIMARY ("COUNTRY")
 )
 IN                   "simple.xml";
 
 
CREATE TABLE          "STATES"
 physical             "dat/states.dat"
 (
  "STATE"             CHARACTER(2),                
  "DESCRIPTION"       STRING(31),                 
  "STATE_CODE"        CHARACTER(2),                
  "REGION"            CHARACTER(2),                
  "COUNTRY"           CHARACTER(2),                
  "TAX_RATE"          FLOAT,                       
  CONSTRAINT STATES_STATE_PK PRIMARY ("STATE"),
  CONSTRAINT STATES_COUNTRY_FK FOREIGN ("COUNTRY") REFERENCES "COUNTRIES"
 )
 IN                   "simple.xml";

Additional Resources

See also:

 
Back to top
admin/basics/rawdata/joins.1299175827.txt.gz ยท Last modified: 2012/10/26 14:51 (external edit)