Series · 3 parts
Improving query performance with indexes using Prisma
A practical series on using database indexes with Prisma, from the fundamentals to specific index types and how to apply them to real queries.
EducationSeptember 6, 2022Updated July 8, 2026
Improving Query Performance with Indexes using Prisma: Introduction
A database index is a secondary data structure that speeds up reads by reducing search scope. Learn the main index types, what they cost, and when to add one.
EducationSeptember 16, 2022Updated July 8, 2026
Improving Query Performance with Indexes using Prisma: B-Tree Indexes
Add a B-tree index in your Prisma schema with @@index and turn a 66ms sequential scan into a sub-millisecond lookup, an 80x improvement verified on Prisma ORM 7 and PostgreSQL 17 with EXPLAIN ANALYZE.
EducationOctober 12, 2022Updated July 8, 2026
Improving Query Performance with Indexes using Prisma: Hash Indexes
Add a hash index in Prisma with @@index(type: Hash): a 64ms sequential scan becomes a 1.6ms lookup, verified on Prisma ORM 7 and PostgreSQL 17.
