Index structures and SARGability
Source reference
These questions cover and PostgreSQL-adapt the concepts in SQL/Query Optimization. Read the source alignment and terminology notes before treating cross-engine index names as PostgreSQL features.
Which predicates can ordinarily use a B-tree range search on an indexed numeric column?
SARGable predicates expose indexed values directly to an index-supported operator.
Why can name LIKE '%interview%' fail to use a normal B-tree search?
A prefix pattern such as name LIKE 'interview%' may use a suitable B-tree/operator class; substring search often needs trigram or full-text design.
What is true of <> and NOT predicates?
The issue is commonly low selectivity, not a syntactic prohibition.
How does PostgreSQL differ from systems with a permanently clustered index?
An index supplies logical order; heap physical order can drift after CLUSTER.
What does a PostgreSQL Bitmap Index Scan create?
Bitmap scans can combine conditions and batch heap access without defining a bitmap index type.
Which index type supports equality but not B-tree range ordering?
PostgreSQL hash indexes are equality-oriented; B-tree remains more versatile for most scalar workloads.
A partial index is most useful when:
The query predicate must imply the partial-index predicate, and omitted rows reduce size and write work.
What makes an index covering for a particular query?
Coverage is query-specific. Visibility-map state still controls whether an index-only scan needs heap fetches.
Which PostgreSQL design typically supports full-text search?
Full-text search tokenizes and normalizes documents instead of treating them as simple left-anchored strings.
Which PostgreSQL families commonly support spatial or geometric access?
Exact choices depend on the geometric type and operator class; PostGIS commonly extends these capabilities.
What are dense and sparse indexes in general database terminology?
They are storage-design concepts, not PostgreSQL CREATE INDEX keywords.
Why should indexes not be added solely because a column appears in WHERE, JOIN, or ORDER BY?
Every index consumes storage and adds maintenance to inserts, updates, deletes, vacuum, and caching.
Return to quiz overview