May 2020
Beginner
564 pages
14h 9m
English
When using a built-in function in your query, the query may not use the indexes on the table. For example, the following query needs to do a full scan of the table:
USE lahmansbaseballdb;SELECT UPPER(playerid) as playeridupper, playeridFROM allstarfullWHERE upper(playerid) = 'AARONHA01';
The following screenshot shows the execution plan of the previous query:

The following query can seek the rows that are needed:
USE lahmansbaseballdb;SELECT playerid FROM allstarfullWHERE playerid = 'aaronha01';
The following screenshot shows the execution plan of the previous query:
You can see that the query that doesn't ...
Read now
Unlock full access