For analytical purposes, we frequently query the rental table with conditions similar to DATE_FORMAT(return_date, '%Y-%m') = 'YYYY-MM' (where 'YYYY-MM' represents a specific year and month). To significantly improve the performance of these queries, create a functional index named idx_return_date_func on the return_date column, utilizing the DATE_FORMAT function.
Expected result
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression |
|---|
Write your query below and click "Check it!". Tables are described in the right pane.
By checking a query, you agree that it is stored without your account details and may be included in anonymized datasets, including for AI training. Learn more
The query result will appear here. Ctrl+Enter - Run query