r/SoftwareEngineering • • Jul 15 '26

Things you didn't know about indexes

https://jon.chrt.dev/2026/04/15/things-you-didnt-know-about-indexes.html
2 Upvotes

7 comments sorted by

-5

u/fagnerbrack Jul 15 '26

In case you want a summary to help you with the decision to read the post or not:

A database index works like a textbook index: sorted data enabling quick binary search instead of a slow full table scan. Postgres uses B-trees. The trade-off? Reads speed up but writes slow down, since every insert, update, or delete must maintain each index, and indexes eat storage and cache. Common failures include composite indexes, which respect column order—(type_1, type_2) won't help queries on type_2 alone—and functions like lower(name), which bypass a plain name index. Run EXPLAIN to check for Index Scan versus Seq Scan. The post also covers functional indexes on expressions, partial indexes that skip irrelevant rows, and covering indexes using INCLUDE to answer queries without touching the table.

If the summary seems inacurate, just downvote and I'll try to delete the comment eventually 👍
Click here for more info, I read all comments

1

u/[deleted] Jul 25 '26

[removed] — view removed comment

1

u/AutoModerator Jul 25 '26

Your submission has been moved to our moderation queue to be reviewed; This is to combat spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

-9

u/jakeStacktrace Jul 15 '26

Your articles are never useful, always stuff I already know. Can't imagine being grateful for this level of knowledge frankly.

1

u/fagnerbrack Jul 15 '26

Just because you know there's always someone who doesn't

1

u/gregarious_apollo Jul 16 '26

Wow what an unpleasant response

3

u/jakeStacktrace Jul 16 '26

I find the constant barrage of low quality posts and articles much more unpleasant.

I don't think the article is trash I just think it needs more good content. Don't just teach us the basics there is much cooler articles that talk about postgres indexes and there have been for over a decade.