IT lexicon › Database › Range index

Range index

Database På svenska → Updated: 2026-11-12

An index that supports range queries — efficiently return all rows where a value falls between A and B.

B-trees and B+-trees are range indexes, unlike hash indexes. With a range index, a database can quickly fetch all salaries between $50K and $100K, or all dates within a fiscal quarter. Hash indexes answer only "is this exact value here?" — they cannot answer "give me all values from A to B" or "sorted order". Range indexes power SQL's ORDER BY and BETWEEN clauses.

Range indexes date back to the ISAM era, but B+-trees made them far more efficient — and now nearly universal. Hash indexes appear only when you absolutely need exact-match performance and don't care about ordering or ranges. Most real-world indexes are range-capable for this reason: the flexibility costs almost nothing and solves the majority of query patterns.

← Back to the lexicon