Differences

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

Link to this comparison view

admin:indexing:creation:declaring [2012/01/26 16:14]
doc
admin:indexing:creation:declaring [2016/06/28 22:38]
Line 1: Line 1:
-~~NOTOC~~ 
  
-{{page>:​top_add&​nofooter&​noeditbtn}} 
-====== Administration:​ Omnidex Indexing ====== 
- 
-===== Indexing Creation ===== 
- 
-[[admin:​indexing:​creation:​home|Overview]] | 
-**[[admin:​indexing:​creation:​declaring|Declaring Indexes]]** |  
-[[admin:​indexing:​creation:​updating|Updating Indexes]] | 
-[[admin:​indexing:​creation:​standalone|Standalone Indexes]] | 
-[[admin:​indexing:​creation:​files|Index Files]] | 
-[[admin:​indexing:​creation:​updating|Maintenance]] 
- 
-==== Declaring Indexes ==== 
- 
-The easiest way to add Omnidex indexes to a table is to append indexing information at the end of each column in the CREATE TABLE statement. ​ This will suffice for most basic installations of Omnidex. ​ The example below shows adding indexes to a table. ​ Some columns have "​omnidex"​ next to them, indicating that a standard Omnidex index should be created. ​ Other columns have "​quicktext"​ next to them, indicating that QuickText index should be created. 
- 
- 
-<code sql> 
-> 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 
-> 
-</​code>​ 
- 
-Some indexes require more options or more information. ​ For example, a multi-column index - an index containing more than one column - cannot be created by simply putting a keyword next to a column. ​ These indexes can be created one of two ways.  Indexes can be declared in the CREATE TABLE statement following all of the constraint declarations as shown in the example below. 
- 
-<code sql> 
-> 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"​),​ 
->> ​  ​omnidex ​   STATE_CITY_ZIP ("​STATE",​ "​CITY",​ "​ZIP"​) case_insensitive 
->> ​ ) 
->> ​ in                   "​simple.xml";​ 
-Table HOUSEHOLDS created in simple.xml 
-> 
-</​code>​ 
- 
-Omnidex indexes can also be created using CREATE INDEX statement. ​ This is a more traditional approach; however, most administrators prefer to use the CREATE TABLE statement since it is easier to differentiate which columns are indexed and which are not. 
- 
-<code sql> 
-> create omnidex index  "​STATE_CITY_ZIP"​ 
->> ​ on                   "​HOUSEHOLDS"​ 
->> ​ ( 
->> ​   "​STATE",​ 
->> ​   "​CITY", ​ 
->> ​   "​ZIP"​ 
->> ​ ) 
->> ​ in                   "​simple.xml";​ 
-Index STATE_CITY_ZIP created in simple.xml 
-> 
-</​code>​ 
- 
-Most commonly, administrators have an [[admin:​basics:​environments:​home|Omnidex Environment File]] that contains all CREATE TABLE and CREATE INDEXES for their database. ​ This SQL file can then be run using OdxSQL, regenerating the Environment File.  Once the revised indexing has been declared, the indexes can be [[admin:​indexing:​creation:​updating|updated]]. 
-====  ====  
- 
-**[[admin:​indexing:​creation:​home|Prev]] | [[admin:​indexing:​creation:​updating|Next]]** 
- 
- 
-====== Additional Resources ====== 
- 
-See also: 
- 
-{{page>:​admin:​indexing:​see_also&​nofooter&​noeditbtn}} 
- 
-{{page>:​bottom_add&​nofooter&​noeditbtn}} 
 
Back to top
admin/indexing/creation/declaring.txt ยท Last modified: 2016/06/28 22:38 (external edit)