Index Scan vs Seek
Index Scan vs Seek is a SQL statement in the Indexes category. Index Seek finds rows via B-tree navigation (O(log n)). Index Scan reads all index entries (O(n)). Seeks are far faster. The syntax is -- Index Seek (fast): direct lookup. Index Scan (slower): full index read.. It returns access method comparison. A typical example: -- Index Seek (good): SELECT * FROM employees WHERE id = 12345; -- B-tree traverses to find id=12345 directly (few pages read) -- Index Scan (worse): SELECT * FROM employees WHERE salary IS NOT NULL; -- Must scan all index entries (many pages read) -- Clustered Index Scan = Table Scan: SELECT * FROM employees; -- No WHERE clause = read all pages -- EXPLAIN output: -- PostgreSQL: Index Scan… A close relative is CREATE INDEX, which creates an index on one or more columns to speed up query performance. A close relative is DROP INDEX, which removes an existing index from a table.