MySQL has introduced the concept of functional index in MySQL 8.0.13. It is one of the much needed feature for query optimisation , we have seen about histogram in my last blog. Let us explore the functional index and its use cases.
For the below explanation, I have used a production scenario which has 16 core cpu, 32GB RAM and with MySQL version 8.0.16(Latest at the time of writing).
MySQL do support indexing on columns or prefixes of column values (length).
Example:
mysql>show create table app_user\G *************************** 1. row *************************** Table: app_user Create Table: CREATE TABLE `app_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ad_id` int(11) DEFAULT NULL, `source` varchar(32) DEFAULT NULL, `medium` varchar(32) DEFAULT NULL, `campaign` varchar(32) DEFAULT NULL, `timestamp` …[Read more]