partitioningtable
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| partitioningtable [2025/03/28 12:03] – jwan | partitioningtable [2025/10/10 10:15] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 43: | Line 43: | ||
| PARTITION p_2023 VALUES LESS THAN (2024), | PARTITION p_2023 VALUES LESS THAN (2024), | ||
| PARTITION p_future VALUES LESS THAN MAXVALUE); | PARTITION p_future VALUES LESS THAN MAXVALUE); | ||
| + | </ | ||
| + | |||
| + | can also be partitioned by list: | ||
| + | < | ||
| + | PARTITION BY LIST (customer_id) ( | ||
| + | PARTITION p_cust_1 VALUES IN (1, 2, 3), | ||
| + | PARTITION p_cust_2 VALUES IN (4, 5, 6), | ||
| + | PARTITION p_cust_3 VALUES IN (7, 8, 9), | ||
| + | PARTITION p_others VALUES IN (DEFAULT)); | ||
| + | </ | ||
| + | |||
| + | or by name initial: | ||
| + | |||
| + | < | ||
| + | PARTITION BY RANGE COLUMNS(customer_name) ( | ||
| + | PARTITION p_a_f VALUES LESS THAN (' | ||
| + | PARTITION p_g_m VALUES LESS THAN (' | ||
| + | PARTITION p_n_s VALUES LESS THAN (' | ||
| + | PARTITION p_t_z VALUES LESS THAN (MAXVALUE)); | ||
| + | </ | ||
| + | |||
| + | File sizes of individual partition are not updated until they are optimized: | ||
| + | |||
| + | < | ||
| + | OPTIMIZE TABLE newtable; | ||
| </ | </ | ||
partitioningtable.1743163417.txt.gz · Last modified: (external edit)
