Index Scan vs Sequential Scan vs Bitmap Scan

November 23, 2025 (1mo ago)

Hi! Hope you're doing well.

In this blog post, we will see how PostgreSQL decides which scan method to use when executing your query.

Let's get jump into this

For this post we are referring to a table like this - 5M rows

The cat trap in action

Index Scan — Fastest When You Look for Specific Rows

Sequential Scan - Reading the Whole Table

Bitmap Scan — The Middle Ground

Alright! So that’s the whole idea. Don’t worry — you don’t have to do any of this manually. Like I said, the database is smart, so trust it to pick the best scan method for you. Alright then, bye-bye!

So --

  1. Index Scan > Bitmap Scan < Table Scan.
  2. Sequential scan (in postgres) == Table Scan.
  3. Parallel Sequence Scan is where your postgres spawns parallel worker threads to scan the table.
  4. Database do all the above stuff with the help of statistics!

credits: Hussein Nasser