Deprecated: Function Yoast\WP\SEO\Conditionals\Schema_Blocks_Conditional::get_feature_flag is deprecated since version Yoast SEO 20.5 with no alternative available. in /home1/minerho3/public_html/wp-includes/functions.php on line 6078

Deprecated: Function Yoast\WP\SEO\Conditionals\Schema_Blocks_Conditional::get_feature_flag is deprecated since version Yoast SEO 20.5 with no alternative available. in /home1/minerho3/public_html/wp-includes/functions.php on line 6078

Deprecated: Function Yoast\WP\SEO\Conditionals\Schema_Blocks_Conditional::get_feature_flag is deprecated since version Yoast SEO 20.5 with no alternative available. in /home1/minerho3/public_html/wp-includes/functions.php on line 6078

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":1766,"date":"2018-07-10T18:08:17","date_gmt":"2018-07-10T18:08:17","guid":{"rendered":"http:\/\/minervadb.com\/?p=1766"},"modified":"2018-07-11T03:49:08","modified_gmt":"2018-07-11T03:49:08","slug":"mysql-partitioning","status":"publish","type":"post","link":"http:\/\/minervadb.com\/index.php\/2018\/07\/10\/mysql-partitioning\/","title":{"rendered":"What is MySQL partitioning ?"},"content":{"rendered":"

MySQL partitioning makes data distribution of individual tables (typically we recommend partition for large & complex I\/O table for performance, scalability and manageability<\/em>) across multiple files based on partition strategy \/ rules. In very simple terms, different portions of table are stored as separate tables in different location to distribute I\/O optimally. The user defined division of data by some rule is known as partition function<\/em>, In MySQL we partition data by RANGE<\/em><\/strong> of values \/ LIST<\/strong><\/em> of values \/ internal hashing function \/ linear hashing function. By restricting the query examination on the selected partitions by matching rows increases the query performance by multiple times compared to the same query on a non partitioned table, This methodology is also called partition pruning (trimming of unwanted partitions), Please find below example of partition pruning:<\/p>\n

CREATE TABLE tab1 (\r\n    col1 VARCHAR(30) NOT NULL,\r\n    col2 VARCHAR(30) NOT NULL,\r\n    col3 TINYINT UNSIGNED NOT NULL,\r\n    col4 DATE NOT NULL\r\n)\r\nPARTITION BY RANGE( col3 ) (\r\n    PARTITION p0 VALUES LESS THAN (100),\r\n    PARTITION p1 VALUES LESS THAN (200),\r\n    PARTITION p2 VALUES LESS THAN (300),\r\n    PARTITION p3 VALUES LESS THAN MAXVALUE\r\n);<\/pre>\n

Write a SELECT query benefitting partition pruning:<\/p>\n

SELECT col1, col2, col3, col4\r\nFROM tab1\r\nWHERE col3 > 200 AND col3 < 250;<\/pre>\n

What is explicit partitioning in MySQL and how is it different from partition pruning ?\u00a0<\/strong><\/p>\n

In MySQL we can explicitly select partition and sub-partitions when executing a statement matching a given WHERE condition, This sounds very much similar to partition pruning, but there is a difference:<\/p>\n