This shows you the differences between two versions of the page.
dev:sql:statements:partition:home [2010/07/02 07:28] tdo |
dev:sql:statements:partition:home [2016/06/28 22:38] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{page>:top_add&nofooter&noeditbtn}} | ||
- | <html><div align="center"><span style="color:red">DRAFT</span></div></html> | ||
- | ====== Omnidex SQL: PARTITION table ====== | ||
- | ===== Description ===== | ||
- | |||
- | Partitions a table into multiple sub partitions which can be useful when setting up an Omnidex grid. | ||
- | |||
- | ===== Syntax ===== | ||
- | <code> | ||
- | PARTITION table | ||
- | [INTO n] | ||
- | [BY <column | expression>] | ||
- | [IN path] | ||
- | [ON [INSTANCE] instance] | ||
- | [WITH options] | ||
- | </code> | ||
- | |||
- | ===== Discussion ===== | ||
- | The partition statement is used with criteria to split a table into multiple components. | ||
- | |||
- | The SQL CASE syntax can be used to specify the suffix used when the PARTITION statement creates the component files. | ||
- | <code> | ||
- | > partition companies by "case when state in ('CA','CO','TX') then '01' when state in ('NY','FL','WA') then '02' else '03' end" ; | ||
- | Partitioned 31,548 rows from COMPANIES into 3 partitions | ||
- | </code> | ||
- | |||
- | |||
- | ===== Examples ===== | ||
- | |||
- | ==== Simple ==== | ||
- | |||
- | ==== 2nd example ==== | ||
- | |||
- | {{page>:bottom_add&nofooter&noeditbtn}} |