Skip to main content
Architecture10 min read

Why I Use Raw SQL Instead of an ORM (Most of the Time)

ORMs are great until they're not. After debugging generated queries that took 30 seconds on a 185-table database, I switched to raw SQL for the hot paths. Here's when each makes sense.

By Jason TeixeiraJanuary 18, 2026
SQLPostgreSQLORMPrismaDatabasePerformance
Share:
On this page

This is going to be controversial, so let me start with the disclaimer: ORMs are fine. Prisma, SQLAlchemy, Drizzle — they're all good tools built by smart people. I use them.

But for the Nexural platform — 185 tables, complex joins, materialized views, row-level security — raw SQL was the right call for the critical paths. Here's why.

The Moment I Switched

I was using Prisma. The dashboard loaded in 200ms locally. In production with real data, it took 4.2 seconds.

I ran \\

Reader route

article -> proof -> offer

ReadClusterProofScope

cluster

Product Systems

intent

Architecture

route

next step

What to do with this

Turn the note into a build path.

If this topic maps to a real business problem, keep reading the cluster, study the academy path, or route the work into a scoped engagement.

Jason Teixeira
Written by
Jason Teixeira
Founder, Sage Ideas Studio · Principal Engineer
livebuild a1556e22026-06-19 03:29Z
// solo studio// no analytics resold// every commit human-reviewed