What is the difference between Lookup, Scan and Seek?

Viewed 18555

So I found this query

SELECT MAX(us.[last_user_lookup]) as [last_user_lookup], MAX(us.[last_user_scan]) 
AS [last_user_scan], MAX(us.[last_user_seek]) as [last_user_seek] 
from sys.dm_db_index_usage_stats as us 
where us.[database_id] = DB_ID() AND us.[object_id] = OBJECT_ID('tblName')
group by us.[database_id], us.[object_id];

when i look up the documentation on sys.dm_db_index_usage_stats all it says is

last_user_seek      datetime    Time of last user seek
last_user_scan      datetime    Time of last user scan.
last_user_lookup    datetime    Time of last user lookup.

...

Every individual seek, scan, lookup, or update on the specified index by one query execution is counted as a use of that index and increments the corresponding counter in this view. Information is reported both for operations caused by user-submitted queries, and for operations caused by internally generated queries, such as scans for gathering statistics.

Now I understand that when I run the query it's getting the highest time of those 3 fields as sys.dm_db_index_usage_stats can have duplicate database_id and object_id where one or more of the fields may also be NULL (so you can just to a SELECT TOP 1 ... ORDER BY last_user_seek, last_user_scan, last_user_lookup DESC otherwise you potentially miss data) but when I run it I get values like

NULL | 2017-05-15 08:56:29.260 | 2017-05-15 08:54:02.510

but I don't understand what the user has done with the table which is represented by these values.

So what is the difference between Lookup, Scan and Seek?

1 Answers
Related