The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Anybody can ask a question
Anybody can answer
The best answers are voted up and moderated by our team

SQL Index exercise

SQL Index exercise


I am working through the index exercise where I extract salary figures of everything above 89000.
It seems that when I create an index for this and then execute the same selection code, it takes longer than when it doesn’t have an index.
Why is this the case? 

1 Answer

365 Team

Hi Josh!
Thanks for reaching out.
Although in this example on some machines the fetch time actually increases when applying the index, the fact is that when your database is much larger, this difference can be reverted significantly, and in that case using indexes will be crucial. That’s why this technique is important and the theory provided in the lectures is actually, in general, valid.
Just depending on computer settings, Workbench version and the like, the fetch time appears slower with indexes in this example for some machines, apparently.
Hope this clarifies the situation but thanks for sharing this information with our Community!

Complete Data Science Education
Get 50% OFF