Hi,
I can figure out why the answer is option C, can someone help me?
The order matters (here is a stack overflow link that explains that in more detail https://stackoverflow.com/questions/2292662/how-important-is-the-order-of-columns-in-indexes)But, if the query is using 2 filters the best option to speed up it's execution is an index with those 2 attributes and the index 3 is the only one that has both attributes.
Hi Pedro, indeed answer C is the best
When both Firstname and Lastname are filled in, the fasted way to search for a record, is an index with both Firstname and Lastname. When for example an index only is on Firstname, the records with the same Firstname are quickly found, but then in all those records, the database must find the record with the same lastname.
After the results are found, a sort / an orderby is done.
The order of the attributes in the index do not matter
Hi Pedro,
The option C is the correct because the aggregate is being filtered by LastName and FirstName, so to speed up that search you need to create an index with both fields.
So, the order doesn't matter?