Your PostgreSQL table has 50 million orders.
But your operational query may care about only the small number still PENDING.
Why maintain an index entry for every completed order?
That's where a Partial Index becomes interesting.
CREATE INDEX idx_orders_pending
ON orders (created_at)
WHERE status = 'PENDING';
The table still contains everything.
The index doesn't have to.
The same idea can be useful for:
🛒 E-commerce → orders still requiring processing
📦 Parcel delivery → parcels not yet delivered
💳 Payments → transactions not yet settled
But there's an important catch:
PostgreSQL can use the partial index only when the planner can establish that the query's conditions imply the index predicate.
So don't add one because it sounds efficient.
Measure the data distribution. Examine the query plan. Test it against the real workload.
Sometimes better indexing isn't about indexing more.
It's about deliberately indexing less.
Database
Source:https://dev.to/anujkumar2/your-postgresql-index-probably-doesnt-need-every-row-12a5
Your PostgreSQL Index Probably Doesn't Need Every Row
dev.to Database0 views

PreviousHow Postman runs Agent Mode for 40 million developers on Amazon BedrockNextPostgreSQL MVCC Autovacuum Starvation: HOT Update Breakdown & Table Bloat under Heavy Write Loads
Related posts
Goravel mail: Mailables, templates and queues
0dev.to WebDev
Goravel scheduling and Artisan commands
0dev.to DevOps
Install Goravel with Docker, Postgres and Redis
0dev.to
Keep file versions and observation dates separate when reading a CSV
0dev.to
Running CDC in Production: The WAL Slot Trap
0dev.to DevOps

How to deploy one app from a monorepo with your own Dockerfile
0dev.to Docker