#splits large database into smaller and manageable ones.
#partitioning large database into numberof rows or number of columns.
# bewlow command will provide whether the mysql support parition
SHOW VARIABLES LIKE ‘%partition%’;– it will show yes
SHOW PLUGINS;– it will show partition active
# following are the different type of partitioning
. Range Prtitioning
. List Partitioning
. Hash Partitioning
. Key Partitioning
Example:
1 2 3 4 5 6 7 8 9 10 |
CREATE TABLE tbl_students ( student name VARCHAR(50) NOT NULL, student_code TINYINT UNSIGNED NOT NULL, ) PARTITION BY RANGE( student_code ) ( PARTITION p0 VALUES LESS THAN (14), PARTITION p1 VALUES LESS THAN (58), PARTITION p2 VALUES LESS THAN (72), ); |
select * from tbl_students where student_code >55 and student_code <57 in this case we need to search only in the partitions p1.