Partial indexes only include a subset of the rows of a table.
I've been able to create partial indexes in Oracle, DB2, PostgreSQL, and SQL Server. For example, in SQL Server I can create the index as:
create index ix1_case on client_case (date)
where status = 'pending';
This index is cheap since it does not include all 5 million rows of the table, but only the pending cases, that should not exceed a thousand rows.
How do I do it in MySQL?
As @Gordon Linoff commented, MySQL does not (yet) support partial indexes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With