Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a Innodb table with a index that looks at 3 columns.

  • ColA is integer and always has a value.
  • ColB is varchar and always has a value.
  • ColC is datetime and sometimes has a value (NULL).

My index appears to be looking at all records representing ColA,B,C (NULL or NOT NULL).

Is it possible to have the index only store ColC NULL values? This would shorten the index considerably (ie 27K to 1K).

share|improve this question
1  
Do you mean that you need the index only for queries with WHERE c IS NULL? You never have other queries involving column c? –  ypercube Apr 22 at 18:10
    
Yes. Only when C IS NULL. –  John M Apr 22 at 18:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.