<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/things-you-didn-t-know-about-indexes-a4znm2ugw" -->

---
title: Things you didn't know about indexes | daily.dev
description: A practical guide to database indexing covering both fundamentals and common pitfalls. Explains how indexes work (B-tree structure, binary search), the...
canonical: https://daily.dev/posts/things-you-didn-t-know-about-indexes-a4znm2ugw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Things you didn't know about indexes | daily.dev
og:description: A practical guide to database indexing covering both fundamentals and common pitfalls. Explains how indexes work (B-tree structure, binary search), the...
og:url: https://daily.dev/posts/things-you-didn-t-know-about-indexes-a4znm2ugw
og:image: https://api.daily.dev/og/posts/a4Znm2UGW.png
og:image:alt: Things you didn't know about indexes
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Things you didn't know about indexes

**[Lobsters](https://daily.dev/sources/lobsters)** · 12 min read · 0 upvotes · 0 comments

## Summary

A practical guide to database indexing covering both fundamentals and common pitfalls. Explains how indexes work (B-tree structure, binary search), the read-fast/write-slow trade-off, and storage costs. Covers four key gotchas and index types: composite index column ordering (left-prefix rule), function-wrapped columns breaking index usage, functional/expression indexes, partial indexes for low-cardinality or filtered data, and covering indexes (Index Only Scan) using PostgreSQL's INCLUDE clause. Uses a Pokémon table as a running example throughout, with EXPLAIN and EXPLAIN ANALYZE shown as diagnostic tools.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://jon.chrt.dev/2026/04/15/things-you-didnt-know-about-indexes.html>

## Similar posts on daily.dev

- [How Database Indexes Work – A Practical Guide with PostgreSQL Examples](https://daily.dev/posts/how-database-indexes-work-a-practical-guide-with-postgresql-examples-8anfbdgcl) · freeCodeCamp · 72 upvotes · 0 comments
- [Introduction to PostgreSQL Indexes ::](https://daily.dev/posts/introduction-to-postgresql-indexes--peasixbnz) · Hacker News · 0 upvotes · 0 comments
- [SQL Indexing Explained: Composite Indexes and Column Order](https://daily.dev/posts/sql-indexing-explained-composite-indexes-and-column-order-exxme3lqv) · Milan Jovanović · 42 upvotes · 1 comments
- [Beyond Indexes: How Open Table Formats Optimize Query Performance — Jack Vanlightly](https://daily.dev/posts/beyond-indexes-how-open-table-formats-optimize-query-performance-jack-vanlightly-inrhgb2yf) · Programming Digest · 0 upvotes · 0 comments

---

Tags: [#backend](https://daily.dev/tags/backend), [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/things-you-didn-t-know-about-indexes-a4znm2ugw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Things you didn't know about indexes","url":"https://daily.dev/posts/things-you-didn-t-know-about-indexes-a4znm2ugw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/things-you-didn-t-know-about-indexes-a4znm2ugw"},"datePublished":"2026-04-15T17:54:08.444Z","dateModified":"2026-04-16T17:54:34.875Z","description":"A practical guide to database indexing covering both fundamentals and common pitfalls. Explains how indexes work (B-tree structure, binary search), the...","image":"https://media.daily.dev/image/upload/s--qPvKM23u--/f_auto/v1722860399/public/Placeholder%2009","thumbnailUrl":"https://media.daily.dev/image/upload/s--qPvKM23u--/f_auto/v1722860399/public/Placeholder%2009","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/things-you-didn-t-know-about-indexes-a4znm2ugw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"backend,postgresql","timeRequired":"PT12M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"Things you didn't know about indexes"}]}
```

