1. [Home](<https://delaparra-services.nl/>) 
1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) 
1. [B-tree index](<https://delaparra-services.nl/knowledge-hub/b-tree-index>)

  

Category: SQL 

# B-tree index

  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    

## What is B-tree index?

 

B-tree index: The default, general-purpose index. Balanced tree that supports equality and range queries and ORDER BY. A B-tree index is the default index type in most relational databases. It keeps values sorted in a balanced tree, so the database can find a row in a few steps instead of reading the whole table.

 

Definition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)

 

## Frequently asked questions about B-tree index

  

### How is B-tree index used in practice?

 

It supports exact matches, ranges and sorting. A query like ` WHERE created_at > '2026-01-01' ORDER BY created_at ` can use a B-tree index on ` created_at ` for both the filter and the order.

    

### What should you keep in mind with B-tree index?

 

The column order in a composite index matters. An index on ` (customer_id, created_at) ` helps queries that filter on ` customer_id `, but not queries that only filter on ` created_at `. Every index also slows down writes a little and uses disk space. Add indexes for the queries you actually run, and use ` EXPLAIN ` to check that the database uses them.

    

### What does an example of B-tree index look like?

 

```
CREATE INDEX idx_orders_created ON orders (created_at);
```

 

## At a glance

   CategorySQL Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026

 

## More SQL terms

 

- [ACID](<https://delaparra-services.nl/knowledge-hub/acid>) 
- [BEGIN / COMMIT / ROLLBACK](<https://delaparra-services.nl/knowledge-hub/begin-commit-rollback>) 
- [CASE](<https://delaparra-services.nl/knowledge-hub/case>) 
- [COALESCE](<https://delaparra-services.nl/knowledge-hub/coalesce>) 
- [composite index](<https://delaparra-services.nl/knowledge-hub/composite-index>) 
- [COUNT / SUM / AVG / MIN / MAX](<https://delaparra-services.nl/knowledge-hub/count-sum-avg-min-max>)

 

[All terms starting with B](<https://delaparra-services.nl/knowledge-hub#letter-b>)

 

## Skills

 

- ### SQL Performance Optimization Assistant

 

'Universal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases (MySQL, PostgreSQL, SQL Server, Oracle). Provides execution plan analysis, pagination optimization, batch operations, and performance monitoring guidance.'

 [View skill](<https://delaparra-services.nl/skills/sql-optimization>) [Download zip](<https://delaparra-services.nl/skills/sql-optimization/download>) 
- ### SQL Optimization Patterns

 

Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.

 [View skill](<https://delaparra-services.nl/skills/sql-optimization-patterns>) [Download zip](<https://delaparra-services.nl/skills/sql-optimization-patterns/download>) 
- ### Supabase Postgres Best Practices

 

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and schedule

 [View skill](<https://delaparra-services.nl/skills/supabase-postgres-best-practices>) [Download zip](<https://delaparra-services.nl/skills/supabase-postgres-best-practices/download>)

 [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/b-tree-index/skills.zip>)

 

## Manuals

 

- [Writing SQL queries and migrations](<https://delaparra-services.nl/manuals/sql-queries-en-migraties>)

 

## Related services

 

- [Custom software and web applications](<https://delaparra-services.nl/services#service-03>)

Perhaps your customers need somewhere to download their invoices, or your staff are managing bookings in a spreadsheet. 
- [AI code review](<https://delaparra-services.nl/services#service-05>)

When you push your new change, I will review your code, help your agent avoid the same mistake again, and get your app ready for deployment.

 

## Need any help?

 

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.

  [Get in touch](<https://delaparra-services.nl/availability>)

[HTML version](https://delaparra-services.nl/knowledge-hub/b-tree-index)
