All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

Debugging a slow password reset query in CockroachDB: from 700k rows to 10

4d ago· 24 min readenInsight

Summary

A software engineer recounts investigating a slow password reset query flagged by their CTO. The query was reading 700k rows instead of the expected ~10 rows. What initially seemed like a simple missing-index fix turned into a deeper investigation involving CockroachDB's query optimizer quirks, index selection issues, and the complexities of database query planning. The engineer walks through the debugging process, the root cause analysis, and the open-sourced fix applied to resolve the performance issue.

Source

bskyDebugging a slow password reset query in CockroachDB: from 700k rows to 10gaultier.github.io

Key quotes

· 3 pulled
This query should not read 700k rows, but like 10 or something.
The plan looks ok IMHO, indices are being used: [copy pasted production plan]
And spoiler alert, he was dead right.
Snippet from the RSS feed
It all started one morning. I opened Slack as usual to start my working day, only to find a message from the CTO:

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.