🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Databases Intermediate

What is B-Tree Index?

The default index type in most databases that organizes data in a balanced tree structure for efficient searching, sorting, and range queries.

B-tree (balanced tree) indexes maintain sorted data in a tree structure where each node can have multiple children. They support equality (=), range (<, >, BETWEEN), ORDER BY, and prefix LIKE queries efficiently.

B-tree indexes are the default in PostgreSQL, MySQL, and most databases. They work well for most use cases but are not optimal for full-text search (use GIN), array/JSON queries (use GIN), or geospatial queries (use GiST). Over-indexing hurts write performance.

Related Terms

Index
A data structure that improves the speed of data retrieval operations on database tables at the cost of additional storage.
SQL
Structured Query Language — the standard language for managing and querying data in relational databases.
NoSQL
A category of databases that store data in non-tabular formats, optimized for specific data models and access patterns.
Cursor
A database object that enables row-by-row processing of query results, useful for operations that cannot be done in bulk.
Graph Database
A database that uses graph structures with nodes, edges, and properties to store and query highly connected data.
Soft Delete
A pattern where records are marked as deleted with a flag or timestamp rather than being physically removed from the database.
View All Databases Terms →