user_id | int(10) PRIMARY username | VARCHAR(25) UNIQUE (other columns removed for example's sake)
ALTER TABLE users PARTITION BY RANGE( username ) (
PARTITION p0 VALUES LESS THAN ('m'),
PARTITION p1 VALUES LESS THAN(MAXVALUE)
);
# VALUES value must be of same type as partition function near [ the 'm' part]
ALTER TABLE users PARTITION BY RANGE( ORD(username) ) ( PARTITION p0 VALUES LESS THAN (109), PARTITION p1 VALUES LESS THAN(MAXVALUE) ); # This partition function is not allowed
ALTER TABLE users PARTITION BY KEY ( username ) PARTITIONS 10 #1503 - A PRIMARY KEY must include all columns in the table's partitioning function
| Subject | Written By | Posted |
|---|---|---|
| Partitioning user table | Tim Walton | 09/13/2009 03:31PM |
| Re: Partitioning user table | Roel Van de Paar | 09/14/2009 06:43AM |
| Re: Partitioning user table | Mattias Jonsson | 09/14/2009 07:57AM |
| Re: Partitioning user table | Tim Walton | 09/14/2009 10:29AM |
Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.