25
My first database query crashed my whole app in 10 seconds
I finally tried SQLite for a small project last night and accidentally ran a SELECT without a WHERE clause on a table with 2 million rows. The app froze for a whole minute before I force quit it. I felt stupid but then I realized I just learned why indexes matter. Has anyone else made a mistake like that their first time using a database?
3 comments
Log in to join the discussion
Log In3 Comments
murphy.abby1mo ago
Sort of disagree here. An index wouldn't fix a SELECT on 2 million rows unless you were selecting just the indexed column.
6
LIMIT and OFFSET could've saved you too, learned that the hard way myself.
3