Junior — Middle
What scanning methods does the query planner perform to find data?
sobes.tech AI
Answer from AI
A query planner (for example, in a DBMS) uses several main scanning methods to find data:
-
Full Table Scan — scanning all rows of a table without using indexes. Used when indexes are absent or the selection is too large.
-
Index Scan — searching data using an index, which allows quickly finding the needed records without scanning the entire table.
-
Range Scan — reading a sequential range of values from an index, effective for queries with conditions like BETWEEN or >, <.
-
Unique Index Scan — fast search for a single record by a unique key.
-
Hash Scan — used in some DBMSs for quick search using hash tables.
The choice of method depends on the query structure, the presence of indexes, and data statistics.