schilly Posted March 26, 2010 Share Posted March 26, 2010 so I'm trying really hard to tune my db and mainly improve the response time of queries which has got me redoing a bunch of indexes. if you have an index on two fields in a table, is it redundant to have another index on just one of those fields? will a query that uses only one of those fields return just as fast with the two field index as it would with the one field one? thx. Quote Link to comment https://forums.phpfreaks.com/topic/196639-more-index-questions/ Share on other sites More sharing options...
JustLikeIcarus Posted March 27, 2010 Share Posted March 27, 2010 is it redundant to have another index on just one of those fields? will a query that uses only one of those fields return just as fast with The answer to both of those wuextions is absolutely not. If you are using only one of the columns in the two column index then that index will not be used. So it is smart practice to index on the single column as well if it will be used a lot iin your queries. Quote Link to comment https://forums.phpfreaks.com/topic/196639-more-index-questions/#findComment-1032582 Share on other sites More sharing options...
fenway Posted March 27, 2010 Share Posted March 27, 2010 I feel like we just covered this question... Quote Link to comment https://forums.phpfreaks.com/topic/196639-more-index-questions/#findComment-1032833 Share on other sites More sharing options...
schilly Posted March 29, 2010 Author Share Posted March 29, 2010 hope it wasn't answered already in my other index post. if so, sorry =( thanks for the help though. Quote Link to comment https://forums.phpfreaks.com/topic/196639-more-index-questions/#findComment-1033607 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.