Partition pruning

Partition pruning is related to the optimization concept in partition. In partition pruning the concept described as Do not scan partitions where no possible matching values can be present is applied based on the query statements.

Suppose there is a partitioned table, tp1, created with the following statement:

CREATE TABLE tp1 (    first_name VARCHAR (30) NOT NULL,    last_name VARCHAR (30) NOT NULL,    zone_code TINYINT UNSIGNED NOT NULL,    doj DATE NOT NULL)PARTITION BY RANGE (zone_code) (    PARTITION p0 VALUES LESS THAN (65),    PARTITION p1 VALUES LESS THAN (129),    PARTITION p2 VALUES LESS THAN (193),    PARTITION p3 VALUES LESS THAN MAXVALUE);

In the preceding example table tp1, suppose you want to retrieve a result from the following ...

Get MySQL 8 Administrator's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.