Skip to Content
MySQL 8 Cookbook
book

MySQL 8 Cookbook

by Karthik Appigatla
January 2018
Intermediate to advanced
446 pages
12h 57m
English
Packt Publishing
Content preview from MySQL 8 Cookbook

Partition selection

Partition pruning is automatic selection based on the WHERE clause. You can explicitly specify the partitions to scan in the query. The queries can be SELECT, DELETE, INSERT, REPLACE, UPDATE, LOAD DATA, and LOAD XML. The PARTITION option is used to select partitions from a given table, you should specify the keyword PARTITION <partition name> immediately following the name of the table, before all other options, including any table alias, for example:

mysql> SELECT emp_no,hire_date FROM employees PARTITION (p1990) LIMIT 10;+--------+------------+| emp_no | hire_date  |+--------+------------+| 413688 | 1989-12-10 || 242368 | 1989-08-06 || 283280 | 1985-11-22 || 405098 | 1985-11-16 ||  30404 | 1985-07-17 || 419259 | 1988-03-21 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

MySQL Cookbook

MySQL Cookbook

Paul DuBois
Advanced MySQL 8

Advanced MySQL 8

Eric Vanier, Birju Shah, Tejaswi Malepati

Publisher Resources

ISBN: 9781788395809Other