All Posts

Speeding Up Postgres Queries with Indices

Newcomers to SQL often find themselves asking: Why are my queries so slow? Sure, they have half a million rows in their table, but they are only fetching a handful using a WHERE clause. How can it take so long just to return a few rows? The simple answer is: databases don't know how you're going to filter the column in your queries. They're smart, but they can't read your mind.