> And what is the difference between index scan and index only scan.
Index scan: Index lookup for key access plus read from data blocks to satisfy the query.
Index only scan: Index lookup for key access plus read from index pages itself to satisfy query. In other words, entire query can
be satisfied by index without bothering to go into data pages. For eg: select count(*) from table where col1 = 123. Assuming col1
is indexed, there is no need to visit data blocks.