This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
admin:features:segments:creating [2012/03/01 22:45] doc |
admin:features:segments:creating [2016/06/28 22:38] (current) |
||
|---|---|---|---|
| Line 9: | Line 9: | ||
| [[admin:features:segments:home|Overview]] | | [[admin:features:segments:home|Overview]] | | ||
| **[[admin:features:segments:creating|Creating Segments]]** | | **[[admin:features:segments:creating|Creating Segments]]** | | ||
| - | [[admin:features:segments:attaching|Attaching Segments]] |[[admin:features:segments:queries|Querying Segments]] | | + | [[admin:features:segments:querying|Querying Segments]] | |
| - | [[admin:features:segments:dropping|Dropping Segments]] | | + | [[admin:features:segments:dropping|Dropping Segments]] |
| - | [[admin:features:segments:archiving|Archiving Segments]] | + | |
| ---- | ---- | ||
| ==== Creating Segments ==== | ==== Creating Segments ==== | ||
| - | |||
| - | === Segment Types === | ||
| - | |||
| - | Omnidex Segments are separated into types that describe their content and their format: | ||
| - | |||
| - | |||
| - | |< 100% 10% 15% 75% >| | ||
| - | ^ Type ^ File Extensions ^ Description ^ | ||
| - | | INDEX | .odxid | This segment contains index pointers representing the rows that match the criteria. | | ||
| - | | DATA | .dat | This segment contains data in binary format without delimiters. | | ||
| - | | DELIMITED | .txt, .csv and .tdf | This segment contains data in character format, with one value per line. | | ||
| - | |||
| - | Omnidex Segments are separated into two types of persistence that describe how filenames and file cleanup are handled: | ||
| - | |||
| - | ^ Persistence ^ Description ^ | ||
| - | | TEMPORARY | Object names are unique to a connection, but may repeat across connections. Omnidex automatically manages the filenames for these segments. This segment can be dropped explicitly if needed; otherwise it will automatically dropped when the connection ends. Segments are temporary by default. | | ||
| - | | PERMANENT | Object names are unique to a connection, but may repeat across connections. The user must provide unique filenames for these segments; otherwise, the object name is used as the filename. This segment will only be deleted if explicitly dropped. | | ||
| - | |||
| - | === Creating Segments === | ||
| Segments are easily creating using the [[dev:sql:statements:create_segment:home|CREATE SEGMENT]] statement. The following example shows a series of segments being created in a multi-step query. | Segments are easily creating using the [[dev:sql:statements:create_segment:home|CREATE SEGMENT]] statement. The following example shows a series of segments being created in a multi-step query. | ||
| <code> | <code> | ||
| - | > ; Create a series of index and data segment files, and then reuse them | + | > ; Create a segment for Individuals in Denver, CO |
| - | > ; in a final query. | + | > create segment PART_1 |
| - | > | + | |
| - | > | + | |
| - | > ; Create a temporary index segment for Individuals in Denver, CO | + | |
| - | > create temporary index segment PART_1 | + | |
| >> as (select INDIVIDUALS.$UNIQUEKEY | >> as (select INDIVIDUALS.$UNIQUEKEY | ||
| >> from INDIVIDUALS | >> from INDIVIDUALS | ||
| >> join HOUSEHOLDS on INDIVIDUALS.HOUSEHOLD = HOUSEHOLDS.HOUSEHOLD | >> join HOUSEHOLDS on INDIVIDUALS.HOUSEHOLD = HOUSEHOLDS.HOUSEHOLD | ||
| - | |||
| >> where STATE = 'CO' and | >> where STATE = 'CO' and | ||
| - | >> CITY = 'Denver') | + | >> CITY = 'Denver'); |
| - | >> with delete; | + | |
| Segment PART_1 created with 37 rows | Segment PART_1 created with 37 rows | ||
| - | > ; Create a temporary index segment for Individuals in Phoenix, AZ; | + | > ; Create segment for Individuals in Phoenix, AZ; |
| - | -> create temporary index segment PART_2 | + | -> create segment PART_2 |
| >> as (select INDIVIDUALS.$UNIQUEKEY | >> as (select INDIVIDUALS.$UNIQUEKEY | ||
| >> from INDIVIDUALS | >> from INDIVIDUALS | ||
| >> join HOUSEHOLDS on INDIVIDUALS.HOUSEHOLD = HOUSEHOLDS.HOUSEHOLD | >> join HOUSEHOLDS on INDIVIDUALS.HOUSEHOLD = HOUSEHOLDS.HOUSEHOLD | ||
| >> where STATE = 'AZ' and | >> where STATE = 'AZ' and | ||
| - | >> CITY = 'Phoenix') | + | >> CITY = 'Phoenix'); |
| - | >> with delete; | + | |
| Segment PART_2 created with 27 rows | Segment PART_2 created with 27 rows | ||
| - | > ; Create a temporary index segment for Individuals born since 1980; | + | > ; Create segment for Individuals born since 1990; |
| - | > create temporary index segment PART_3 | + | > create segment PART_3 |
| >> as (select INDIVIDUALS.$UNIQUEKEY | >> as (select INDIVIDUALS.$UNIQUEKEY | ||
| >> from INDIVIDUALS | >> from INDIVIDUALS | ||
| - | >> where BIRTHDATE >= 'January 1, 1980') | + | >> where BIRTHDATE >= 'January 1, 1990'); |
| - | >> with delete; | + | Segment PART_3 created with 1,198 rows |
| - | Segment PART_3 created with 1,882 rows | + | |
| </code> | </code> | ||
| ==== ==== | ==== ==== | ||
| - | **[[admin:features:segments:attaching|Next]]** | + | **[[admin:features:segments:home|Prev]]** | |
| + | **[[admin:features:segments:querying|Next]]** | ||