Indexing only one MySQL column value

Posted by BrainCore on Stack Overflow See other posts from Stack Overflow or by BrainCore
Published on 2010-03-23T05:52:40Z Indexed on 2010/03/23 6:13 UTC
Read the original article Hit count: 400

Filed under:
|
|
|
|

I have a MySQL InnoDB table with a status column. The status can be 'done' or 'processing'. As the table grows, at most .1% of the status values will be 'processing,' whereas the other 99.9% of the values will be 'done.' This seems like a great candidate for an index due to the high selectivity for 'processing' (though not for 'done'). Is it possible to create an index for the status column that only indexes the value 'processing'? I do not want the index to waste an enormous amount of space indexing 'done.'

© Stack Overflow or respective owner

Related posts about mysql

Related posts about innodb