Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
admin:basics:environments:create [2011/01/13 17:34]
els
admin:basics:environments:create [2012/01/19 22:02]
doc
Line 1: Line 1:
 +~~NOTOC~~
 +
 {{page>:​top_add&​nofooter&​noeditbtn}} {{page>:​top_add&​nofooter&​noeditbtn}}
  
-====== Administration:​ Omnidex ​Basics ​======+====== Administration:​ Omnidex ​Fundamentals ​======
  
 ===== Omnidex Environments ===== ===== Omnidex Environments =====
Line 13: Line 15:
 ---- ----
  
-==== Creating ​Environments ​====+==== Creating ​Environment Files ====
  
-There are two methods to create Omnidex ​Environments.  They can be created interactively using the [[programs:​odxadmin:​home|Omnidex Administrator]],​ or they can be created using SQL statements such as [[dev:​sql:​statements:​create_environment:​home|CREATE ENVIRONMENT]],​ [[dev:​sql:​statements:​create_database:​home|CREATE DATABASE]], [[dev:​sql:​statements:​create_table:​home|CREATE TABLE]] and [[dev:​sql:​statements:​create_index:​home|CREATE INDEX]]. ​ Once created, a simple Omnidex Environment File will look like this:+There are two methods to create Omnidex ​Environment Files.  They can be created interactively using the [[programs:​odxadmin:​home|Omnidex Administrator]],​ or they can be created using SQL statements such as [[dev:​sql:​statements:​create_environment:​home|CREATE ENVIRONMENT]],​ [[dev:​sql:​statements:​create_database:​home|CREATE DATABASE]], [[dev:​sql:​statements:​create_table:​home|CREATE TABLE]] and [[dev:​sql:​statements:​create_index:​home|CREATE INDEX]]. ​ Once created, a simple Omnidex Environment File will look like this:
  
-<​code>​ +<​code ​sql
-create environment ​    +create environment 
- ​in ​                  "​simple.xml"​ +>>  ​in                   "​simple.xml"​ 
- ​with ​                ​delete;​+>>  ​with                 ​delete;​ 
 +Environment created in simple.xml 
 +
 +
 +> create database ​      "​SIMPLE"​ 
 +>> ​ type                 ​FILE 
 +>> ​ index_directory ​     "​idx"​ 
 +>> ​ in                   "​simple.xml";​ 
 +Database SIMPLE created in simple.xml 
 +
 +> create table          "​HOUSEHOLDS"​ 
 +>> ​ physical ​            "​dat/​households.dat"​ 
 +>> ​ ( 
 +>> ​  "​HOUSEHOLD" ​        ​CHARACTER(12),​ 
 +>> ​  "​ADDRESS" ​          ​CHARACTER(50),​ 
 +>> ​  "​CITY" ​             CHARACTER(28),​ 
 +>> ​  "​STATE" ​            ​CHARACTER(2),​ 
 +>> ​  "​ZIP" ​              ​CHARACTER(5),​ 
 +>> ​  "​COUNTRY" ​          ​CHARACTER(2),​ 
 +>> ​  ​constraint HSHD_HOUSEHOLD_PK primary ("​HOUSEHOLD"​) 
 +>> ​ ) 
 +>> ​ in                   "​simple.xml";​ 
 +Table HOUSEHOLDS created in simple.xml 
 +
 +
 +> create table          "​INDIVIDUALS"​ 
 +>> ​ physical ​            "​dat/​individuals.dat"​ 
 +>> ​ ( 
 +>> ​  "​INDIVIDUAL" ​       CHARACTER(12),​ 
 +>> ​  "​HOUSEHOLD" ​        ​CHARACTER(12),​ 
 +>> ​  "​NAME" ​             CHARACTER(50),​ 
 +>> ​  "​GENDER" ​           CHARACTER(1),​ 
 +>> ​  "​BIRTHDATE" ​        ANSI DATE, 
 +>> ​  "​PHONE" ​            ​CHARACTER(14),​ 
 +>> ​  "​EMAIL" ​            ​CHARACTER(60),​ 
 +>> ​  ​constraint IND_INDIVIDUAL_PK primary ("​INDIVIDUAL"​),​ 
 +>> ​  ​constraint IND_HOUSEHOLD_FK foreign ("​HOUSEHOLD"​) references "​HOUSEHOLDS"​ 
 +>> ​ ) 
 +>> ​ in                   "​simple.xml";​ 
 +Table INDIVIDUALS created in simple.xml 
 +
 +</​code>​
  
 +==== Adding Omnidex Indexing ====
  
-create database ​      "​SIMPLE"​ +The easiest way to add Omnidex Indexing is to add indexing information beside each column.  ​This will not work in all situationssuch as when multi-column indexes are being created; howeverit will work in many simpler installations. ​ More complex installations will require the more complex features described ​in [[dev:​sql:​statements:​create_table:​home|CREATE TABLE]] and [[dev:​sql:​statements:​create_index:​home|CREATE INDEX]] The example below shows the basic addition of Omnidex indexing to the same database.  ​
- ​type ​                ​FLATFILE +
- ​index_directory ​     "​idx"​ +
- ​in ​                  "​simple.xml";​ +
- +
-create table          "​HOUSEHOLDS"​ +
- ​physical ​            "​dat\households.dat" +
- ( +
-  "​HOUSEHOLD" ​        ​CHARACTER(12)               +
-  "​ADDRESS" ​          ​CHARACTER(50)               +
-  "​CITY" ​             CHARACTER(28), ​               +
-  "​STATE" ​            ​CHARACTER(2), ​                +
-  "​ZIP" ​              ​CHARACTER(5), ​                +
-  "​COUNTRY" ​          ​CHARACTER(2), ​                +
-  constraint HSHD_HOUSEHOLD_PK primary ("​HOUSEHOLD"​) +
- ) +
- in                   "​simple.xml";​ +
- +
- +
-create table          "​INDIVIDUALS"​ +
- ​physical ​            "​dat\individuals.dat" +
- ( +
-  "​INDIVIDUAL" ​       CHARACTER(12), ​               +
-  "​HOUSEHOLD" ​        ​CHARACTER(12), ​               +
-  "​NAME" ​             CHARACTER(50), ​                +
-  "​GENDER" ​           CHARACTER(1), ​                    +
-  "​BIRTHDATE" ​        ANSI DATE,                 +
-  "​PHONE" ​            ​CHARACTER(14), ​               +
-  "​EMAIL" ​            ​CHARACTER(60), ​                  +
-  constraint IND_INDIVIDUAL_PK primary ("​INDIVIDUAL"​),​ +
-  constraint IND_HOUSEHOLD_FK foreign ("​HOUSEHOLD"​) references "​HOUSEHOLDS"​ +
- ) +
- ​in ​                  "​simple.xml";​+
  
 +<code sql>
 +> create environment
 +>> ​ in                   "​simple.xml"​
 +>> ​ with                 ​delete;​
 +Environment created in simple.xml
 +>
 +>
 +> create database ​      "​SIMPLE"​
 +>> ​  ​type ​               FILE
 +>> ​  ​index_directory ​    "​idx"​
 +>> ​ in                   "​simple.xml";​
 +Database SIMPLE created in simple.xml
 +>
 +>
 +> create table          "​HOUSEHOLDS"​
 +>> ​ physical ​            "​dat/​households.dat"​
 +>> ​ (
 +>> ​  "​HOUSEHOLD" ​        ​CHARACTER(12) ​    ​omnidex,​
 +>> ​  "​ADDRESS" ​          ​CHARACTER(50) ​    ​quicktext,​
 +>> ​  "​CITY" ​             CHARACTER(28) ​    ​quicktext,​
 +>> ​  "​STATE" ​            ​CHARACTER(2) ​     omnidex,
 +>> ​  "​ZIP" ​              ​CHARACTER(5) ​     omnidex,
 +>> ​  "​COUNTRY" ​          ​CHARACTER(2) ​     omnidex,
 +>> ​  ​constraint HOUSEHOLDS_HOUSEHOLD_PK primary ("​HOUSEHOLD"​)
 +>> ​ )
 +>> ​ in                   "​simple.xml";​
 +Table HOUSEHOLDS created in simple.xml
 +>
 +>
 +> 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"​
 +>> ​ )
 +>> ​ in                   "​simple.xml";​
 +Table INDIVIDUALS created in simple.xml
 </​code>​ </​code>​
  
-==== Adding ​Omnidex ​Indexing ​====+==== Updating ​Omnidex ​Indexes ​====
  
-The easiest way to add Omnidex ​Indexing ​is to add indexing information beside ​each column.  ​This will not work in all situations, such as when multi-column ​indexes are being created.  ​However, ​the example below shows the basic addition of Omnidex indexing ​to the same database.+When Omnidex ​indexing ​is added to an Omnidex Environment,​ only the metadata about each index  is added to the environment.  ​The indexes ​themselves ​are not built until an UPDATE INDEXES statement is issued.  ​This is of great benefit since it allows multiple indexes to be built with one scan of the data.  Omnidex applications frequently involve many Omnidex indexes, and building them individually would be prohibitively slow.  The example below connects ​to the newly create environment and updates the indexes.
  
 <​code>​ <​code>​
-create environment ​   ​ +> connect simple 
- in                   "​simple.xml" +Connected to D:​\class\lab1\simple.xml 
- with                 ​delete;​+
 +> update indexes 
 +Database 
 + ​Table ​                                      ​Rows ​       CPU    Elapsed 
 +---------------------------------------------------------------------------- 
 +SIMPLE 
 + ​HOUSEHOLDS ​                                ​1,​909 ​      ​0:​00 ​      ​0:​00 
 + ​INDIVIDUALS ​                               5,000       ​0:​00 ​      ​0:​00 
 +---------------------------------------------------------------------------- 
 +Total                                                   ​0:​00 ​      0:03
  
 +Omnidex indexes updated
 +>
 +</​code>​
  
-create database ​      "​SIMPLE"​ 
-  type                FLATFILE 
-  index_directory ​    "​idx"​ 
- ​in ​                  "​simple.xml";​ 
- 
- 
-create table          "​HOUSEHOLDS"​ 
- ​physical ​            "​dat\households.dat"​ 
- ( 
-  "​HOUSEHOLD" ​        ​CHARACTER(12) ​    ​omnidex,​ 
-  "​ADDRESS" ​          ​CHARACTER(50) ​    ​quicktext,​ 
-  "​CITY" ​             CHARACTER(28) ​    ​quicktext,​ 
-  "​STATE" ​            ​CHARACTER(2) ​     omnidex, 
-  "​ZIP" ​              ​CHARACTER(5) ​     omnidex, 
-  "​COUNTRY" ​          ​CHARACTER(2) ​     omnidex, 
-  constraint HOUSEHOLDS_HOUSEHOLD_PK primary ("​HOUSEHOLD"​) 
- ) 
- ​in ​                  "​simple.xml";​ 
- 
- 
-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"​ 
- ) 
- ​in ​                  "​simple.xml";​ 
-</​code>​ 
  
 =====  ===== =====  =====
 
Back to top
admin/basics/environments/create.txt · Last modified: 2016/06/28 22:38 (external edit)