Pergunta

I had never heard of covering indexes before and just came across them. I was reading this page on them and it says..

"A covering index can dramatically speed up data retrieval but may itself be large due to the additional keys, which slow down data insertion & update. To reduce such index size, some systems allow non-key fields to be included in the index. Non-key fields are not themselves part of the index ordering but only included at the leaf level, allowing for a covering index with less overall index size."

So my question is how do you know if your system allows non-key fields to be included in the index?

Foi útil?

Solução

MySQL does not (currently) support non-Key columns. For other DMBS you will need to check the reference manual.

A similar question has been asked and answered here. However since the performance improvement gained by using covering indexes is generally greater for non-selective queries returning a large number of rows, I can't envisage the solution of just including the extra columns within the index itself ever offering a performance improvement. However, there may be scenarios I am not thinking of, and yours may be one of these, so as always when looking for performance improvement, testing, execution plans and IO statistics will tell you far more than my conjecture!

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top