This is an old revision of the document!


Administration: Omnidex Features

Rollup Tables

Indexing Rollup Tables

Once the rollup tables have been created and declared, they may be indexed using Omnidex indexing. There are no restrictions on indexing of rollup tables, and rollup tables can be indexed just like any other table. Typically, they would be installed with both Omnidex MDK and Aggregation indexes.

Since rollup tables are often quite small, it is common to heavily index the rollup table. Ultimately, it is only necessary to index the rollup table in such a way that all queries that are redirected to the rollup table are fully optimized. This can be determined by reviewing the query plan for each query that is redirected to the rollup table. This is discussed in more detail later in this document.

CREATE TABLE          "INDIVIDUALS"
 physical             "dat/individuals.dat"
 (
  "INDIVIDUAL"        CHARACTER(12)     omnidex,
  "HOUSEHOLD"         CHARACTER(12)     omnidex,
  "NAME"              CHARACTER(50)     quicktext,
  "GENDER"            CHARACTER(1)      omnidex bitmap,
  "BIRTHDATE"         ANSI DATE         omnidex,
  "PHONE"             CHARACTER(14)     omnidex,
  "EMAIL"             CHARACTER(60)     quicktext,
  CONSTRAINT INDIVIDUALS_INDIVIDUAL_PK PRIMARY ("INDIVIDUAL"),
  CONSTRAINT INDIVIDUALS_HOUSEHOLD_FK FOREIGN ("HOUSEHOLD") REFERENCES "HOUSEHOLDS",
  CONSTRAINT INDIVIDUALS_GENDER_FK FOREIGN ("GENDER") REFERENCES "GENDERS",
 )
 IN                   "simple.xml";
 
CREATE TABLE          "INDIVIDUALS_BY_HOUSEHOLD"
 physical             "dat/individuals_by_household.dat"
 (
  "HOUSEHOLD"         CHARACTER(12)     omnidex,
  "GENDER"            CHARACTER(1)      omnidex bitmap,
  "BIRTHDATE"         ANSI DATE         omnidex,
  "NUM_INDIVIDUALS"   UNSIGNED INTEGER,
  CONSTRAINT INDIVIDUALS_HOUSEHOLD_FK FOREIGN ("HOUSEHOLD") REFERENCES "HOUSEHOLDS",
  CONSTRAINT INDIVIDUALS_GENDER_FK FOREIGN ("GENDER") REFERENCES "GENDERS",
 )
 AS "select           HOUSEHOLD,
                      GENDER,
                      BIRTHDATE,
                      count(*)  NUM_INDIVIDUALS
       from           INDIVIDUALS
       group by       HOUSEHOLD,
                      GENDER,
                      BIRTHDATE"
 IN                   "simple.xml";
 
 
CREATE TABLE          "INDIVIDUALS_BY_DEMO"
 physical             "dat/individuals_by_demo.dat"
 (
  "GENDER"            CHARACTER(1)      omnidex bitmap,
  "BIRTHDATE"         ANSI DATE         omnidex,
  "NUM_INDIVIDUALS"   UNSIGNED INTEGER,
  CONSTRAINT INDIVIDUALS_GENDER_FK FOREIGN ("GENDER") REFERENCES "GENDERS",
 )
 AS "select           GENDER,
                      BIRTHDATE,
                      count(*)  NUM_INDIVIDUALS
       from           INDIVIDUALS
       group by       GENDER,
                      BIRTHDATE"
 IN                   "simple.xml";

Additional Resources

 
Back to top
admin/features/rollups/indexing.1329496649.txt.gz ยท Last modified: 2016/06/28 22:38 (external edit)