Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does MySQL support partial indexes?

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?

like image 994
The Impaler Avatar asked Mar 20 '18 23:03

The Impaler


1 Answers

As @Gordon Linoff commented, MySQL does not (yet) support partial indexes.

like image 200
The Impaler Avatar answered Sep 28 '22 07:09

The Impaler