By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
I have a question regarding composite indexes. I have just taken over a database and I notice that there are redundant composite indexes for various tables. By redundant I mean, for example, that TABLE T1 has INDEX_1 on columns (col1, col2, col3), and there is a second index INDEX_2 on columns (col1, col2, col3, col4). I would like to know why two indexes of this kind are required? In such a case isn't it possible to get rid of INDEX_1, since the columns indexed in INDEX_1 are part of INDEX_2 as well and are in fact in the same order, so automatically INDEX_2 can be used for all queries on col1, col2, col3 and col4. Please let me know if I am missing anything.
You are correct. INDEX_1 is redundant and should be dropped.