Query Translation Layer
Prisma translates your query inputs into database-specific SQL. This enables cross-database behavior and Prisma's API semantics, but adds processing time before the database sees the SQL.
Love Prisma's DX but need lower read overhead on supported query shapes?
Current benchmark JSON shows average speedups across Prisma v6, v7, and v8 for supported PostgreSQL and SQLite reads; individual query shapes vary.
import { PrismaClient, Prisma } from '@prisma/client'
import { speedExtension, convertDMMFToModels } from 'prisma-sql'
import postgres from 'postgres'
const sql = postgres(process.env.DATABASE_URL)
const models = convertDMMFToModels(Prisma.dmmf.datamodel)
const prisma = new PrismaClient().$extends(
speedExtension({ postgres: sql, models })
)
const users = await prisma.user.findMany({
where: { status: 'ACTIVE' },
include: { posts: true }
}) Understanding Prisma's evolution and performance characteristics helps explain why this extension exists.
Prisma 2 launched in 2019, changing the TypeScript ORM landscape with type-safe database access and generated types from your schema. Prisma introduced an engine-based architecture to translate queries, validate them, and provide strong guarantees that were hard to achieve with traditional JavaScript ORMs.
Prisma added powerful features like nested writes, transactions, and middleware. The feature set expanded, but every query still paid an architectural cost: queries are represented, validated, executed, and results are shaped to match the Prisma API.
As more teams deployed Prisma in high-traffic workloads, the fixed per-query overhead became measurable. This is most visible on read-heavy endpoints, analytics, aggregations, and large result sets. The overhead is not a bug; it's the cost of Prisma’s guarantees and API behavior.
Prisma shipped major updates focused on performance and engine changes. Even with improvements, there is still an unavoidable cost to parsing, validating, planning, and shaping results compared to executing raw SQL directly.
This extension focuses on read performance. It bypasses Prisma’s read execution path for findMany, findFirst, findUnique, count, aggregate, and groupBy, while keeping Prisma for writes, migrations, schema management, and type generation. Validate compatibility with your Prisma version before rollout.
Prisma made the right architectural choices for its goals: type safety, developer experience, and cross-database behavior. But those choices create overhead that's noticeable at scale. This extension doesn't replace Prisma—it optimizes reads for teams that want Prisma's DX plus faster execution where it matters.
Prisma translates your query inputs into database-specific SQL. This enables cross-database behavior and Prisma's API semantics, but adds processing time before the database sees the SQL.
Prisma validates queries against the schema and enforces API-level guarantees. These safeguards prevent classes of bugs, but they also add overhead to each query.
Results are shaped to match Prisma's API behavior. This is great for DX and consistency, but it adds latency, especially on large result sets and complex includes.
This extension complements Prisma by offering a faster path for supported read queries. You keep Prisma for schema, migrations, writes, and generated types while generated SQL handles selected hot reads through database-native clients.
Latest benchmark JSON comparison across Prisma v6, v7, v8, Drizzle ORM, and prisma-sql
3 latest version runs • 95 query cases per run
benchmark-results/v6-postgres-latest.json benchmark-results/v7-postgres-latest.json benchmark-results/v8-postgres-latest.json 3 latest version runs • 83 query cases per run
benchmark-results/v6-sqlite-latest.json benchmark-results/v7-sqlite-latest.json benchmark-results/v8-sqlite-latest.json Generated from 6 latest benchmark JSON files in this checkout. The detailed table below uses the same data, a 1ms practical-significance threshold, and separate runtime/prerendered methodology. View detailed benchmark table → View complete benchmark data →
Statistical comparison with Welch's t-test and a 1ms practical significance threshold
These results reflect runtime mode, where queries are converted to SQL on each request. In prerendered mode, SQL is generated at build time — runtime executes raw parameterized queries with zero conversion overhead.
| Test | Prisma | prisma-sql | Drizzle | Speedup | Sig. | CV% | n |
|---|---|---|---|---|---|---|---|
| findMany basic | 0.519ms ±0.023 | 0.233ms ±0.012 | 1.42ms | ~1.00x | ≈ | 18.5% | 50 |
| findMany where = | 0.614ms ±0.022 | 0.577ms ±0.065 | 0.444ms | ~1.00x | ≈ | 40.4% | 50 |
| findMany where >= | 16.16ms ±0.370 | 4.77ms ±0.364 | 6.19ms | 3.39x 1.30x D | *** | 27.5% | 50 |
| findMany where IN | 0.588ms ±0.019 | 0.314ms ±0.012 | 0.411ms | ~1.00x | ≈ | 14.2% | 50 |
| findMany where null | 0.266ms ±0.0097 | 0.141ms ±0.0050 | 0.188ms | ~1.00x | ≈ | 13.0% | 50 |
| findMany ILIKE | 0.208ms ±0.0089 | 0.221ms ±0.011 | 0.159ms | ~1.00x | ≈ | 17.5% | 50 |
| findMany AND | 2.94ms ±0.081 | 0.951ms ±0.096 | 2.13ms | 3.09x 2.24x D | *** | 36.4% | 50 |
| findMany OR | 16.23ms ±4.17 | 4.44ms ±0.470 | 5.47ms | 3.66x 1.23x D | *** | 38.2% | 50 |
| findMany NOT | 0.606ms ±0.022 | 0.385ms ±0.029 | 0.374ms | ~1.00x | ≈ | 27.0% | 50 |
| findMany orderBy | 1.85ms ±0.077 | 1.19ms ±0.228 | 0.730ms | ~1.00x | ≈ | 69.2% | 50 |
| findMany pagination | 0.223ms ±0.011 | 0.211ms ±0.012 | 0.369ms | ~1.00x | ≈ | 20.6% | 50 |
| findMany select | 0.248ms ±0.014 | 0.137ms ±0.0042 | 0.099ms | ~1.00x | ≈ | 10.9% | 50 |
| findMany relation some | 0.869ms ±0.016 | 0.451ms ±0.0061 | — | ~1.00x | ≈ | 4.8% | 50 |
| findMany relation every | 0.714ms ±0.023 | 0.501ms ±0.013 | — | ~1.00x | ≈ | 9.6% | 50 |
| findMany relation none | 29.48ms ±1.51 | 9.80ms ±1.02 | — | 3.01x | *** | 16.8% | 10 |
| findMany nested relation | 1.52ms ±0.051 | 1.25ms ±0.065 | — | ~1.00x | ≈ | 18.8% | 50 |
| findMany complex | 2.25ms ±0.092 | 1.28ms ±0.229 | 1.28ms | ~1.00x | ≈ | 64.8% | 50 |
| findFirst | 0.841ms ±0.143 | 0.281ms ±0.033 | 0.399ms | ~1.00x | ≈ | 42.1% | 50 |
| findFirst skip | 0.449ms ±0.200 | 0.198ms ±0.011 | 0.491ms | ~1.00x | ≈ | 19.6% | 50 |
| findUnique id | 0.412ms ±0.102 | 0.289ms ±0.036 | 0.247ms | ~1.00x | ≈ | 44.8% | 50 |
| findUnique email | 0.373ms ±0.114 | 0.299ms ±0.080 | 0.217ms | ~1.00x | ≈ | 97.1% | 50 |
| count | 0.136ms ±0.0083 | 0.095ms ±0.011 | 0.104ms | ~1.00x | ≈ | 40.8% | 50 |
| count where | 1.17ms ±0.063 | 0.735ms ±0.027 | 0.457ms | ~1.00x | ≈ | 13.3% | 50 |
| aggregate count | 0.248ms ±0.0042 | 0.192ms ±0.0033 | — | ~1.00x | ≈ | 6.2% | 50 |
| aggregate sum/avg | 0.335ms ±0.0044 | 0.272ms ±0.0028 | — | ~1.00x | ≈ | 3.7% | 50 |
| aggregate where | 0.471ms ±0.016 | 0.319ms ±0.012 | — | ~1.00x | ≈ | 14.1% | 50 |
| aggregate min/max | 0.349ms ±0.019 | 0.284ms ±0.0039 | — | ~1.00x | ≈ | 4.8% | 50 |
| aggregate complete | 0.426ms ±0.0055 | 0.324ms ±0.0028 | — | ~1.00x | ≈ | 3.1% | 50 |
| groupBy | 0.475ms ±0.038 | 0.414ms ±0.049 | — | ~1.00x | ≈ | 43.0% | 50 |
| groupBy count | 0.467ms ±0.017 | 1.17ms ±0.542 | — | ~1.00x | ≈ | 167.5% | 50 |
| groupBy multi | 0.634ms ±0.034 | 0.464ms ±0.012 | — | ~1.00x | ≈ | 9.1% | 50 |
| groupBy having | 0.567ms ±0.028 | 0.609ms ±0.072 | — | ~1.00x | ≈ | 42.8% | 50 |
| groupBy + where | 0.555ms ±0.017 | 0.382ms ±0.012 | — | ~1.00x | ≈ | 11.4% | 50 |
| _count via include | 0.676ms ±0.024 | 0.716ms ±0.091 | — | ~1.00x | ≈ | 45.6% | 50 |
| _count via include + relations | 1.53ms ±0.030 | 1.37ms ±0.028 | — | ~1.00x | ≈ | 7.5% | 50 |
| groupBy aggregates | 0.550ms ±0.024 | 0.627ms ±0.074 | — | ~1.00x | ≈ | 42.4% | 50 |
| groupBy min/max | 0.570ms ±0.047 | 0.418ms ±0.0036 | — | ~1.00x | ≈ | 3.0% | 50 |
| include list + nested to-one | 1.50ms ±0.037 | 0.481ms ±0.056 | — | 3.12x | *** | 42.2% | 50 |
| include list + nullable to-one | 2.49ms ±0.042 | 1.68ms ±0.179 | — | ~1.00x | ≈ | 38.6% | 50 |
| include posts | 3.82ms ±0.187 | 1.04ms ±0.010 | 5.11ms | 3.68x 4.91x D | *** | 3.5% | 50 |
| include profile | 0.519ms ±0.022 | 0.476ms ±0.025 | 0.496ms | ~1.00x | ≈ | 18.7% | 50 |
| include 3 levels | 1.71ms ±0.025 | 1.85ms ±0.203 | 2.05ms | ~1.00x | ≈ | 39.4% | 50 |
| include 4 levels | 2.27ms ±0.090 | 1.69ms ±0.106 | 3.04ms | ~1.00x | ≈ | 22.6% | 50 |
| include + where | 2.26ms ±0.081 | 1.63ms ±0.087 | 4.25ms | ~1.00x | ≈ | 19.4% | 50 |
| include + select nested | 3.66ms ±0.134 | 1.94ms ±0.058 | 5.09ms | 1.89x 2.63x D | *** | 10.8% | 50 |
| findMany startsWith | 0.296ms ±0.118 | 0.219ms ±0.027 | 0.201ms | ~1.00x | ≈ | 44.7% | 50 |
| findMany endsWith | 0.528ms ±0.012 | 0.288ms ±0.0067 | 0.328ms | ~1.00x | ≈ | 8.4% | 50 |
| findMany NOT contains | 0.644ms ±0.050 | 0.228ms ±0.012 | 0.347ms | ~1.00x | ≈ | 19.5% | 50 |
| findMany LIKE | 0.186ms ±0.0086 | 0.113ms ±0.0025 | 0.103ms | ~1.00x | ≈ | 7.9% | 50 |
| findMany < | 26.16ms ±0.559 | 6.09ms ±0.410 | 8.79ms | 4.29x 1.44x D | *** | 24.3% | 50 |
| findMany <= | 26.84ms ±0.550 | 5.84ms ±0.286 | 9.14ms | 4.59x 1.56x D | *** | 17.7% | 50 |
| findMany > | 14.99ms ±0.405 | 4.24ms ±0.290 | 6.41ms | 3.54x 1.51x D | *** | 24.7% | 50 |
| findMany NOT IN | 0.566ms ±0.019 | 0.360ms ±0.032 | 0.331ms | ~1.00x | ≈ | 31.7% | 50 |
| findMany isNot null | 0.554ms ±0.016 | 0.218ms ±0.0050 | 0.312ms | ~1.00x | ≈ | 8.2% | 50 |
| orderBy multi-field | 2.35ms ±0.116 | 0.851ms ±0.086 | 0.642ms | 2.76x 0.75x D | *** | 36.5% | 50 |
| orderBy relation to-one | 2.06ms ±0.029 | 1.63ms ±0.044 | — | ~1.00x | ≈ | 9.8% | 50 |
| orderBy relation + scalar | 2.03ms ±0.058 | 1.47ms ±0.025 | — | ~1.00x | ≈ | 6.2% | 50 |
| orderBy nullable relation | 1.85ms ±0.077 | 1.16ms ±0.012 | — | ~1.00x | ≈ | 3.9% | 50 |
| orderBy deep relation | 2.18ms ±0.058 | 1.62ms ±0.042 | — | ~1.00x | ≈ | 9.4% | 50 |
| orderBy deep relation + scalar | 2.54ms ±0.043 | 1.94ms ±0.033 | — | ~1.00x | ≈ | 6.1% | 50 |
| distinct status | 7.89ms ±0.080 | 1.77ms ±0.190 | — | 4.47x | *** | 38.8% | 50 |
| distinct multi | 12.31ms ±0.244 | 2.46ms ±0.071 | — | 5.01x | *** | 10.4% | 50 |
| cursor composite tuple | 1.58ms ±0.022 | 1.42ms ±0.169 | — | ~1.00x | ≈ | 42.9% | 50 |
| cursor composite desc | 1.77ms ±0.031 | 1.33ms ±0.011 | — | ~1.00x | ≈ | 2.9% | 50 |
| cursor prefix of orderBy | 1.65ms ±0.023 | 1.23ms ±0.0089 | — | ~1.00x | ≈ | 2.6% | 50 |
| select + include | 0.983ms ±0.025 | 0.979ms ±0.146 | 0.339ms | ~1.00x | ≈ | 53.7% | 50 |
| _count relation | 0.719ms ±0.014 | 0.579ms ±0.0094 | — | ~1.00x | ≈ | 5.9% | 50 |
| _count multi-relation | 0.233ms ±0.035 | 0.171ms ±0.0042 | — | ~1.00x | ≈ | 9.0% | 50 |
| _count inside include | 1.14ms ±0.017 | 1.20ms ±0.227 | — | ~1.00x | ≈ | 68.5% | 50 |
| _count inside nested select | 1.65ms ±0.018 | 1.47ms ±0.012 | — | ~1.00x | ≈ | 2.9% | 50 |
| _count deep include | 1.76ms ±0.025 | 1.21ms ±0.014 | — | ~1.00x | ≈ | 4.2% | 50 |
| ILIKE special chars | 0.219ms ±0.0064 | 0.192ms ±0.0075 | — | ~1.00x | ≈ | 14.2% | 50 |
| LIKE case sensitive | 0.216ms ±0.011 | 0.158ms ±0.0047 | — | ~1.00x | ≈ | 10.7% | 50 |
| findMany Date range | 0.352ms ±0.0075 | 0.182ms ±0.0042 | 0.245ms | ~1.00x | ≈ | 8.2% | 50 |
| count Date range | 0.463ms ±0.039 | 0.347ms ±0.0080 | 0.372ms | ~1.00x | ≈ | 8.4% | 50 |
| findMany Date gte | 0.334ms ±0.0072 | 0.172ms ±0.012 | 0.214ms | ~1.00x | ≈ | 25.3% | 50 |
| depth-1 low-fan | 0.369ms ±0.0075 | 0.215ms ±0.0053 | — | ~1.00x | ≈ | 8.7% | 50 |
| depth-1 mid-fan | 2.35ms ±0.108 | 0.927ms ±0.097 | — | 2.53x | *** | 37.8% | 50 |
| depth-1 high-fan | 2.32ms ±0.125 | 0.967ms ±0.136 | — | 2.40x | *** | 50.7% | 50 |
| depth-1 wide | 2.18ms ±0.096 | 0.882ms ±0.022 | — | 2.47x | *** | 8.9% | 50 |
| depth-1 unbound | 39.90ms ±0.937 | 9.17ms ±0.533 | — | 4.35x | *** | 21.0% | 50 |
| depth-2 | 5.07ms ±0.263 | 3.43ms ±0.205 | — | 1.48x | *** | 21.5% | 50 |
| depth-2 paginated Project→tasks | 2.28ms ±0.759 | 5.13ms ±1.45 | — | 0.44x | ** | 101.9% | 50 |
| depth-2 high-fan | 4.46ms ±0.341 | 2.49ms ±0.455 | — | 1.79x | *** | 65.8% | 50 |
| depth-2 wide | 4.65ms ±0.258 | 3.96ms ±0.192 | — | ~1.00x | ≈ | 17.5% | 50 |
| depth-2 unbound | 65.22ms ±3.66 | 21.68ms ±4.66 | — | 3.01x | *** | 34.7% | 10 |
| depth-3 unbound | 16.11ms ±0.478 | 7.77ms ±0.395 | — | 2.07x | *** | 18.3% | 50 |
| depth-3 paginated | 1.90ms ±0.208 | 2.39ms ±0.307 | — | ~1.00x | ≈ | 46.3% | 50 |
| depth-4 unbound | 9.10ms ±0.192 | 5.01ms ±0.315 | — | 1.82x | *** | 22.7% | 50 |
| depth-4 paginated | 1.91ms ±0.049 | 1.94ms ±0.297 | — | ~1.00x | ≈ | 55.4% | 50 |
| findFirst depth-2 | 2.12ms ±0.147 | 1.32ms ±0.253 | — | ~1.00x | ≈ | 69.0% | 50 |
| findUnique depth-2 Project→tasks→comment | 2.16ms ±0.113 | 2.11ms ±0.081 | — | ~1.00x | ≈ | 13.9% | 50 |
| complex nested select | 3.88ms ±0.236 | 3.47ms ±0.190 | — | ~1.00x | ≈ | 19.8% | 50 |
| ultra deep query | 14.80ms ±0.289 | 6.69ms ±0.325 | — | 2.21x | *** | 17.6% | 50 |
| transaction: (3 operations) | 3.50ms ±0.589 | 1.43ms ±0.061 | — | 2.45x | *** | 15.4% | 50 |
| Test | Prisma | prisma-sql | Drizzle | Speedup | Sig. | CV% | n |
|---|---|---|---|---|---|---|---|
| findMany basic | 0.332ms ±0.031 | 0.337ms ±0.045 | 0.490ms | ~1.00x | ≈ | 48.7% | 50 |
| findMany where = | 0.429ms ±0.046 | 0.351ms ±0.017 | 0.499ms | ~1.00x | ≈ | 17.4% | 50 |
| findMany where >= | 10.61ms ±1.28 | 9.24ms ±3.91 | 5.99ms | 1.15x 0.65x D | ns | 152.5% | 50 |
| findMany where IN | 0.471ms ±0.034 | 0.528ms ±0.068 | 0.518ms | ~1.00x | ≈ | 46.8% | 50 |
| findMany where null | 0.352ms ±0.050 | 0.167ms ±0.014 | 0.218ms | ~1.00x | ≈ | 29.7% | 50 |
| findMany ILIKE | 0.307ms ±0.024 | 0.349ms ±0.136 | 0.326ms | ~1.00x | ≈ | 140.6% | 50 |
| findMany AND | 2.10ms ±0.151 | 2.74ms ±0.852 | 2.18ms | ~1.00x | ≈ | 112.3% | 50 |
| findMany OR | 7.19ms ±0.417 | 4.28ms ±0.435 | 5.17ms | 1.68x 1.21x D | *** | 36.6% | 50 |
| findMany NOT | 0.421ms ±0.027 | 0.372ms ±0.013 | 0.423ms | ~1.00x | ≈ | 12.5% | 50 |
| findMany orderBy | 1.82ms ±0.070 | 0.756ms ±0.101 | 0.632ms | 2.41x 0.84x D | *** | 48.2% | 50 |
| findMany pagination | 0.116ms ±0.014 | 0.179ms ±0.0072 | 0.151ms | ~1.00x | ≈ | 14.6% | 50 |
| findMany select | 0.116ms ±0.0075 | 0.118ms ±0.0069 | 0.107ms | ~1.00x | ≈ | 21.3% | 50 |
| findMany relation some | 0.565ms ±0.017 | 0.482ms ±0.017 | — | ~1.00x | ≈ | 13.1% | 50 |
| findMany relation every | 0.585ms ±0.034 | 0.515ms ±0.036 | — | ~1.00x | ≈ | 25.0% | 50 |
| findMany relation none | 13.47ms ±0.886 | 8.43ms ±0.679 | — | 1.60x | *** | 29.0% | 50 |
| findMany nested relation | 0.586ms ±0.015 | 0.538ms ±0.033 | — | ~1.00x | ≈ | 22.1% | 50 |
| findMany complex | 0.728ms ±0.013 | 0.573ms ±0.124 | 0.538ms | ~1.00x | ≈ | 78.2% | 50 |
| findFirst | 0.135ms ±0.0083 | 0.194ms ±0.0078 | 0.187ms | ~1.00x | ≈ | 14.5% | 50 |
| findFirst skip | 0.101ms ±0.0044 | 0.123ms ±0.0044 | 0.158ms | ~1.00x | ≈ | 13.2% | 50 |
| findUnique id | 0.112ms ±0.012 | 0.084ms ±0.0019 | 0.261ms | ~1.00x | ≈ | 8.8% | 50 |
| findUnique email | 0.088ms ±0.0083 | 0.086ms ±0.0019 | 0.141ms | ~1.00x | ≈ | 7.9% | 50 |
| count | 0.068ms ±0.0047 | 0.043ms ±0.0017 | 0.047ms | ~1.00x | ≈ | 13.6% | 50 |
| count where | 1.82ms ±0.978 | 0.504ms ±0.323 | 0.284ms | 3.60x 0.56x D | * | 231.2% | 50 |
| aggregate count | 0.192ms ±0.011 | 0.269ms ±0.098 | — | ~1.00x | ≈ | 131.3% | 50 |
| aggregate sum/avg | 0.275ms ±0.0080 | 0.260ms ±0.0075 | — | ~1.00x | ≈ | 10.3% | 50 |
| aggregate where | 0.376ms ±0.0064 | 0.286ms ±0.015 | — | ~1.00x | ≈ | 19.0% | 50 |
| aggregate min/max | 0.301ms ±0.0069 | 0.290ms ±0.019 | — | ~1.00x | ≈ | 23.0% | 50 |
| aggregate complete | 0.513ms ±0.083 | 0.382ms ±0.030 | — | ~1.00x | ≈ | 29.0% | 50 |
| groupBy | 1.52ms ±0.207 | 1.29ms ±0.284 | — | ~1.00x | ≈ | 79.4% | 50 |
| groupBy count | 0.635ms ±0.139 | 0.433ms ±0.028 | — | ~1.00x | ≈ | 23.1% | 50 |
| groupBy multi | 1.01ms ±0.243 | 0.657ms ±0.071 | — | ~1.00x | ≈ | 39.2% | 50 |
| groupBy having | 0.630ms ±0.108 | 0.772ms ±0.098 | — | ~1.00x | ≈ | 45.7% | 50 |
| groupBy + where | 0.581ms ±0.067 | 0.379ms ±0.0078 | — | ~1.00x | ≈ | 7.4% | 50 |
| _count via include | 0.648ms ±0.019 | 0.675ms ±0.016 | — | ~1.00x | ≈ | 8.8% | 50 |
| _count via include + relations | 1.57ms ±0.192 | 3.56ms ±0.845 | — | 0.44x | *** | 85.8% | 50 |
| groupBy aggregates | 1.78ms ±0.819 | 0.448ms ±0.013 | — | 3.97x | ** | 10.6% | 50 |
| groupBy min/max | 0.836ms ±0.277 | 0.606ms ±0.070 | — | ~1.00x | ≈ | 41.5% | 50 |
| include list + nested to-one | 3.17ms ±0.410 | 1.32ms ±0.176 | — | 2.41x | *** | 48.2% | 50 |
| include list + nullable to-one | 3.84ms ±0.488 | 3.37ms ±0.235 | — | ~1.00x | ≈ | 25.2% | 50 |
| include posts | 3.92ms ±0.870 | 2.44ms ±0.197 | 11.05ms | 1.61x 4.54x D | ** | 29.1% | 50 |
| include profile | 0.288ms ±0.014 | 0.451ms ±0.030 | 0.575ms | ~1.00x | ≈ | 23.8% | 50 |
| include 3 levels | 1.77ms ±0.279 | 1.27ms ±0.048 | 3.49ms | ~1.00x | ≈ | 13.6% | 50 |
| include 4 levels | 1.74ms ±0.197 | 1.34ms ±0.108 | 1.59ms | ~1.00x | ≈ | 28.9% | 50 |
| include + where | 0.728ms ±0.015 | 0.772ms ±0.040 | 1.91ms | ~1.00x | ≈ | 18.8% | 50 |
| include + select nested | 0.625ms ±0.014 | 0.839ms ±0.085 | 1.83ms | ~1.00x | ≈ | 36.4% | 50 |
| findMany startsWith | 0.116ms ±0.014 | 0.152ms ±0.0064 | 0.177ms | ~1.00x | ≈ | 15.4% | 50 |
| findMany endsWith | 0.293ms ±0.055 | 0.239ms ±0.0091 | 0.248ms | ~1.00x | ≈ | 13.7% | 50 |
| findMany NOT contains | 0.213ms ±0.0083 | 0.201ms ±0.0072 | 0.249ms | ~1.00x | ≈ | 12.9% | 50 |
| findMany LIKE | 0.086ms ±0.0053 | 0.107ms ±0.0050 | 0.126ms | ~1.00x | ≈ | 17.2% | 50 |
| findMany < | 26.40ms ±10.54 | 13.26ms ±3.71 | 13.43ms | 1.99x 1.01x D | * | 101.0% | 50 |
| findMany <= | 14.94ms ±1.44 | 17.79ms ±4.57 | 9.77ms | 0.84x 0.55x D | ns | 92.7% | 50 |
| findMany > | 7.18ms ±0.233 | 4.27ms ±0.290 | 5.89ms | 1.68x 1.38x D | *** | 24.5% | 50 |
| findMany NOT IN | 0.424ms ±0.030 | 0.571ms ±0.082 | 0.706ms | ~1.00x | ≈ | 51.7% | 50 |
| findMany isNot null | 0.366ms ±0.031 | 0.227ms ±0.0100 | 0.298ms | ~1.00x | ≈ | 16.0% | 50 |
| orderBy multi-field | 3.62ms ±0.348 | 1.41ms ±0.068 | 0.795ms | 2.57x 0.56x D | *** | 17.4% | 50 |
| orderBy relation to-one | 4.42ms ±0.749 | 1.77ms ±0.192 | — | 2.50x | *** | 39.2% | 50 |
| orderBy relation + scalar | 1.82ms ±0.053 | 1.43ms ±0.014 | — | ~1.00x | ≈ | 3.5% | 50 |
| orderBy nullable relation | 1.66ms ±0.076 | 1.32ms ±0.109 | — | ~1.00x | ≈ | 29.7% | 50 |
| orderBy deep relation | 1.86ms ±0.016 | 1.65ms ±0.099 | — | ~1.00x | ≈ | 21.5% | 50 |
| orderBy deep relation + scalar | 2.32ms ±0.038 | 2.06ms ±0.076 | — | ~1.00x | ≈ | 13.3% | 50 |
| distinct status | 15.33ms ±2.50 | 2.16ms ±0.360 | — | 7.10x | *** | 60.1% | 50 |
| distinct multi | 19.93ms ±2.17 | 3.93ms ±0.383 | — | 5.07x | *** | 35.1% | 50 |
| cursor composite tuple | 4.41ms ±0.587 | 8.00ms ±2.87 | — | 0.55x | * | 129.6% | 50 |
| cursor composite desc | 4.67ms ±0.249 | 4.62ms ±0.440 | — | ~1.00x | ≈ | 34.4% | 50 |
| cursor prefix of orderBy | 1.62ms ±0.098 | 3.23ms ±0.105 | — | 0.50x | *** | 11.8% | 50 |
| select + include | 0.650ms ±0.063 | 1.36ms ±1.16 | 0.451ms | ~1.00x | ≈ | 307.7% | 50 |
| _count relation | 1.42ms ±0.164 | 1.18ms ±0.172 | — | ~1.00x | ≈ | 52.4% | 50 |
| _count multi-relation | 0.468ms ±0.066 | 0.795ms ±0.680 | — | ~1.00x | ≈ | 308.7% | 50 |
| _count inside include | 3.48ms ±0.232 | 3.61ms ±0.577 | — | ~1.00x | ≈ | 57.7% | 50 |
| _count inside nested select | 4.44ms ±0.261 | 5.21ms ±0.376 | — | ~1.00x | ≈ | 26.1% | 50 |
| _count deep include | 4.51ms ±0.317 | 5.06ms ±0.703 | — | ~1.00x | ≈ | 50.1% | 50 |
| ILIKE special chars | 0.354ms ±0.056 | 0.401ms ±0.055 | — | ~1.00x | ≈ | 49.4% | 50 |
| LIKE case sensitive | 0.161ms ±0.027 | 0.174ms ±0.011 | — | ~1.00x | ≈ | 23.4% | 50 |
| findMany Date range | 1.38ms ±0.028 | 0.687ms ±0.060 | 0.597ms | ~1.00x | ≈ | 31.8% | 50 |
| count Date range | 0.496ms ±0.055 | 0.660ms ±0.075 | 0.785ms | ~1.00x | ≈ | 41.2% | 50 |
| findMany Date gte | 0.307ms ±0.068 | 0.703ms ±0.324 | 0.345ms | ~1.00x | ≈ | 166.3% | 50 |
| depth-1 low-fan | 0.941ms ±0.129 | 0.974ms ±0.198 | — | ~1.00x | ≈ | 73.5% | 50 |
| depth-1 mid-fan | 4.14ms ±0.703 | 4.11ms ±0.534 | — | ~1.00x | ≈ | 46.9% | 50 |
| depth-1 high-fan | 2.35ms ±0.339 | 2.26ms ±0.208 | — | ~1.00x | ≈ | 33.3% | 50 |
| depth-1 wide | 2.40ms ±0.282 | 1.32ms ±0.210 | — | 1.82x | *** | 57.4% | 50 |
| depth-1 unbound | 27.65ms ±4.73 | 21.67ms ±3.08 | — | 1.28x | * | 51.3% | 50 |
| depth-2 | 3.57ms ±0.432 | 3.95ms ±0.606 | — | ~1.00x | ≈ | 55.3% | 50 |
| depth-2 paginated Project→tasks | 2.02ms ±0.348 | 3.54ms ±0.141 | — | 0.57x | *** | 14.4% | 50 |
| depth-2 high-fan | 2.60ms ±0.368 | 2.85ms ±0.450 | — | ~1.00x | ≈ | 56.9% | 50 |
| depth-2 wide | 3.11ms ±0.284 | 3.74ms ±0.756 | — | ~1.00x | ≈ | 72.8% | 50 |
| depth-2 unbound | 29.42ms ±1.53 | 41.01ms ±10.18 | — | 0.72x | * | 89.6% | 50 |
| depth-3 unbound | 8.85ms ±0.675 | 6.97ms ±0.362 | — | 1.27x | *** | 18.7% | 50 |
| depth-3 paginated | 1.40ms ±0.266 | 2.82ms ±0.322 | — | 0.49x | *** | 41.1% | 50 |
| depth-4 unbound | 5.91ms ±0.382 | 3.82ms ±0.608 | — | 1.55x | *** | 57.5% | 50 |
| depth-4 paginated | 1.24ms ±0.095 | 1.22ms ±0.165 | — | ~1.00x | ≈ | 48.9% | 50 |
| findFirst depth-2 | 0.845ms ±0.101 | 0.872ms ±0.011 | — | ~1.00x | ≈ | 4.6% | 50 |
| findUnique depth-2 Project→tasks→comment | 0.903ms ±0.141 | 0.908ms ±0.035 | — | ~1.00x | ≈ | 13.9% | 50 |
| complex nested select | 2.92ms ±0.034 | 1.94ms ±0.022 | — | ~1.00x | ≈ | 4.0% | 50 |
| ultra deep query | 8.44ms ±1.17 | 5.60ms ±0.115 | — | 1.51x | *** | 7.4% | 50 |
| transaction: (3 operations) | 2.53ms ±0.097 | 1.27ms ±0.049 | — | 2.00x | *** | 13.9% | 50 |
| Test | Prisma | prisma-sql | Drizzle | Speedup | Sig. | CV% | n |
|---|---|---|---|---|---|---|---|
| findMany basic | 1.73ms ±0.498 | 0.607ms ±0.144 | 0.951ms | 2.85x 1.57x D | *** | 85.8% | 50 |
| findMany where = | 0.337ms ±0.021 | 0.458ms ±0.070 | 0.378ms | ~1.00x | ≈ | 54.7% | 50 |
| findMany where >= | 8.37ms ±0.648 | 5.44ms ±0.720 | 5.58ms | 1.54x 1.03x D | *** | 47.7% | 50 |
| findMany where IN | 0.908ms ±0.410 | 1.49ms ±0.545 | 0.671ms | ~1.00x | ≈ | 131.9% | 50 |
| findMany where null | 0.628ms ±0.273 | 0.462ms ±0.165 | 0.300ms | ~1.00x | ≈ | 128.8% | 50 |
| findMany ILIKE | 0.204ms ±0.019 | 0.268ms ±0.010 | 0.135ms | ~1.00x | ≈ | 13.8% | 50 |
| findMany AND | 1.61ms ±0.150 | 0.664ms ±0.060 | 1.25ms | ~1.00x | ≈ | 32.9% | 50 |
| findMany OR | 7.82ms ±0.759 | 3.95ms ±0.314 | 5.55ms | 1.98x 1.41x D | *** | 28.7% | 50 |
| findMany NOT | 0.429ms ±0.040 | 0.412ms ±0.030 | 0.425ms | ~1.00x | ≈ | 26.4% | 50 |
| findMany orderBy | 1.54ms ±0.051 | 0.939ms ±0.078 | 0.604ms | ~1.00x | ≈ | 30.1% | 50 |
| findMany pagination | 0.125ms ±0.0094 | 0.176ms ±0.020 | 0.176ms | ~1.00x | ≈ | 40.4% | 50 |
| findMany select | 0.173ms ±0.087 | 0.122ms ±0.0036 | 0.102ms | ~1.00x | ≈ | 10.6% | 50 |
| findMany relation some | 0.529ms ±0.0094 | 0.452ms ±0.021 | — | ~1.00x | ≈ | 17.0% | 50 |
| findMany relation every | 0.540ms ±0.0067 | 0.436ms ±0.0047 | — | ~1.00x | ≈ | 3.9% | 50 |
| findMany relation none | 12.36ms ±0.448 | 7.04ms ±0.401 | — | 1.76x | *** | 20.5% | 50 |
| findMany nested relation | 0.538ms ±0.013 | 0.448ms ±0.018 | — | ~1.00x | ≈ | 14.3% | 50 |
| findMany complex | 1.08ms ±0.116 | 0.470ms ±0.0055 | 0.550ms | ~1.00x | ≈ | 4.2% | 50 |
| findFirst | 0.173ms ±0.030 | 0.191ms ±0.024 | 0.207ms | ~1.00x | ≈ | 45.6% | 50 |
| findFirst skip | 0.116ms ±0.0100 | 0.217ms ±0.119 | 0.158ms | ~1.00x | ≈ | 198.9% | 50 |
| findUnique id | 0.099ms ±0.0094 | 0.127ms ±0.014 | 0.111ms | ~1.00x | ≈ | 39.0% | 50 |
| findUnique email | 0.097ms ±0.0072 | 0.089ms ±0.0047 | 0.103ms | ~1.00x | ≈ | 18.9% | 50 |
| count | 0.066ms ±0.0042 | 0.045ms ±0.0017 | 0.056ms | ~1.00x | ≈ | 14.2% | 50 |
| count where | 0.962ms ±0.194 | 0.578ms ±0.257 | 0.760ms | ~1.00x | ≈ | 160.2% | 50 |
| aggregate count | 0.537ms ±0.143 | 0.317ms ±0.085 | — | ~1.00x | ≈ | 96.6% | 50 |
| aggregate sum/avg | 0.684ms ±0.113 | 0.652ms ±0.126 | — | ~1.00x | ≈ | 69.5% | 50 |
| aggregate where | 1.03ms ±0.225 | 0.355ms ±0.045 | — | ~1.00x | ≈ | 46.0% | 50 |
| aggregate min/max | 1.75ms ±0.335 | 1.59ms ±0.453 | — | ~1.00x | ≈ | 102.5% | 50 |
| aggregate complete | 0.398ms ±0.011 | 0.632ms ±0.156 | — | ~1.00x | ≈ | 89.0% | 50 |
| groupBy | 0.455ms ±0.070 | 0.471ms ±0.058 | — | ~1.00x | ≈ | 44.4% | 50 |
| groupBy count | 0.459ms ±0.050 | 0.518ms ±0.082 | — | ~1.00x | ≈ | 56.9% | 50 |
| groupBy multi | 0.465ms ±0.0080 | 0.467ms ±0.016 | — | ~1.00x | ≈ | 12.4% | 50 |
| groupBy having | 0.413ms ±0.0094 | 0.515ms ±0.065 | — | ~1.00x | ≈ | 45.8% | 50 |
| groupBy + where | 0.428ms ±0.0100 | 0.377ms ±0.034 | — | ~1.00x | ≈ | 32.5% | 50 |
| _count via include | 0.603ms ±0.013 | 0.635ms ±0.014 | — | ~1.00x | ≈ | 7.9% | 50 |
| _count via include + relations | 1.26ms ±0.055 | 1.36ms ±0.083 | — | ~1.00x | ≈ | 22.1% | 50 |
| groupBy aggregates | 0.434ms ±0.0053 | 0.428ms ±0.0047 | — | ~1.00x | ≈ | 4.0% | 50 |
| groupBy min/max | 0.428ms ±0.0042 | 0.415ms ±0.0028 | — | ~1.00x | ≈ | 2.4% | 50 |
| include list + nested to-one | 0.935ms ±0.025 | 0.508ms ±0.123 | — | ~1.00x | ≈ | 87.3% | 50 |
| include list + nullable to-one | 2.01ms ±0.431 | 1.69ms ±0.205 | — | ~1.00x | ≈ | 43.8% | 50 |
| include posts | 1.17ms ±0.144 | 1.16ms ±0.097 | 2.36ms | ~1.00x | ≈ | 30.2% | 50 |
| include profile | 0.272ms ±0.021 | 0.341ms ±0.023 | 0.454ms | ~1.00x | ≈ | 24.1% | 50 |
| include 3 levels | 1.18ms ±0.035 | 1.33ms ±0.096 | 1.54ms | ~1.00x | ≈ | 26.0% | 50 |
| include 4 levels | 1.36ms ±0.044 | 1.07ms ±0.020 | 1.29ms | ~1.00x | ≈ | 6.6% | 50 |
| include + where | 0.800ms ±0.094 | 0.757ms ±0.019 | 1.70ms | ~1.00x | ≈ | 9.2% | 50 |
| include + select nested | 0.617ms ±0.012 | 0.812ms ±0.072 | 1.62ms | ~1.00x | ≈ | 32.0% | 50 |
| findMany startsWith | 0.122ms ±0.0072 | 0.163ms ±0.0047 | 0.174ms | ~1.00x | ≈ | 10.4% | 50 |
| findMany endsWith | 0.242ms ±0.0089 | 0.265ms ±0.080 | 0.250ms | ~1.00x | ≈ | 109.0% | 50 |
| findMany NOT contains | 0.222ms ±0.0042 | 0.207ms ±0.0028 | 0.293ms | ~1.00x | ≈ | 4.8% | 50 |
| findMany LIKE | 0.095ms ±0.0094 | 0.123ms ±0.0097 | 0.191ms | ~1.00x | ≈ | 28.7% | 50 |
| findMany < | 12.51ms ±1.67 | 7.29ms ±0.578 | 8.65ms | 1.72x 1.19x D | *** | 28.6% | 50 |
| findMany <= | 12.71ms ±2.36 | 6.78ms ±0.273 | 9.03ms | 1.87x 1.33x D | *** | 14.5% | 50 |
| findMany > | 6.64ms ±0.274 | 4.90ms ±0.517 | 6.44ms | 1.35x 1.31x D | *** | 38.1% | 50 |
| findMany NOT IN | 0.398ms ±0.038 | 0.596ms ±0.221 | 0.446ms | ~1.00x | ≈ | 134.0% | 50 |
| findMany isNot null | 0.287ms ±0.026 | 0.260ms ±0.0078 | 0.199ms | ~1.00x | ≈ | 10.6% | 50 |
| orderBy multi-field | 1.94ms ±0.069 | 0.596ms ±0.044 | 0.608ms | 3.25x 1.02x D | *** | 26.6% | 50 |
| orderBy relation to-one | 2.50ms ±0.419 | 1.35ms ±0.024 | — | 1.85x | *** | 6.3% | 50 |
| orderBy relation + scalar | 1.85ms ±0.040 | 1.69ms ±0.104 | — | ~1.00x | ≈ | 22.2% | 50 |
| orderBy nullable relation | 1.46ms ±0.026 | 1.13ms ±0.016 | — | ~1.00x | ≈ | 5.2% | 50 |
| orderBy deep relation | 1.86ms ±0.040 | 1.57ms ±0.027 | — | ~1.00x | ≈ | 6.3% | 50 |
| orderBy deep relation + scalar | 2.28ms ±0.050 | 1.94ms ±0.051 | — | ~1.00x | ≈ | 9.4% | 50 |
| distinct status | 8.59ms ±0.272 | 1.13ms ±0.100 | — | 7.61x | *** | 32.1% | 50 |
| distinct multi | 11.66ms ±0.168 | 2.43ms ±0.044 | — | 4.80x | *** | 6.5% | 50 |
| cursor composite tuple | 1.45ms ±0.022 | 1.30ms ±0.032 | — | ~1.00x | ≈ | 9.0% | 50 |
| cursor composite desc | 1.52ms ±0.024 | 1.41ms ±0.043 | — | ~1.00x | ≈ | 11.0% | 50 |
| cursor prefix of orderBy | 1.80ms ±0.077 | 1.22ms ±0.032 | — | ~1.00x | ≈ | 9.3% | 50 |
| select + include | 0.531ms ±0.011 | 0.635ms ±0.0075 | 0.339ms | ~1.00x | ≈ | 4.2% | 50 |
| _count relation | 0.602ms ±0.049 | 0.703ms ±0.046 | — | ~1.00x | ≈ | 23.5% | 50 |
| _count multi-relation | 0.165ms ±0.0030 | 0.159ms ±0.0028 | — | ~1.00x | ≈ | 6.1% | 50 |
| _count inside include | 0.819ms ±0.018 | 1.08ms ±0.053 | — | ~1.00x | ≈ | 17.7% | 50 |
| _count inside nested select | 1.92ms ±0.291 | 1.87ms ±0.185 | — | ~1.00x | ≈ | 35.8% | 50 |
| _count deep include | 1.49ms ±0.034 | 1.44ms ±0.072 | — | ~1.00x | ≈ | 17.9% | 50 |
| ILIKE special chars | 0.148ms ±0.0100 | 0.190ms ±0.022 | — | ~1.00x | ≈ | 41.9% | 50 |
| LIKE case sensitive | 0.117ms ±0.0072 | 0.162ms ±0.0058 | — | ~1.00x | ≈ | 12.8% | 50 |
| findMany Date range | 0.136ms ±0.0042 | 0.169ms ±0.0100 | 0.186ms | ~1.00x | ≈ | 21.3% | 50 |
| count Date range | 0.313ms ±0.0039 | 0.336ms ±0.0050 | 0.318ms | ~1.00x | ≈ | 5.3% | 50 |
| findMany Date gte | 0.135ms ±0.0064 | 0.150ms ±0.0078 | 0.166ms | ~1.00x | ≈ | 18.4% | 50 |
| depth-1 low-fan | 0.395ms ±0.180 | 0.219ms ±0.011 | — | ~1.00x | ≈ | 18.3% | 50 |
| depth-1 mid-fan | 1.02ms ±0.119 | 0.886ms ±0.011 | — | ~1.00x | ≈ | 4.3% | 50 |
| depth-1 high-fan | 0.945ms ±0.144 | 0.875ms ±0.165 | — | ~1.00x | ≈ | 67.9% | 50 |
| depth-1 wide | 0.822ms ±0.129 | 0.771ms ±0.017 | — | ~1.00x | ≈ | 7.7% | 50 |
| depth-1 unbound | 16.84ms ±0.530 | 9.74ms ±0.429 | — | 1.73x | *** | 15.9% | 50 |
| depth-2 | 2.92ms ±0.164 | 2.49ms ±0.153 | — | ~1.00x | ≈ | 22.1% | 50 |
| depth-2 paginated Project→tasks | 0.981ms ±0.105 | 1.97ms ±0.280 | — | ~1.00x | ≈ | 51.3% | 50 |
| depth-2 high-fan | 1.12ms ±0.093 | 1.23ms ±0.048 | — | ~1.00x | ≈ | 14.2% | 50 |
| depth-2 wide | 1.40ms ±0.173 | 1.43ms ±0.141 | — | ~1.00x | ≈ | 35.4% | 50 |
| depth-2 unbound | 32.67ms ±2.21 | 19.43ms ±2.38 | — | 1.68x | *** | 44.2% | 50 |
| depth-3 unbound | 8.11ms ±0.283 | 6.22ms ±0.219 | — | 1.30x | *** | 12.7% | 50 |
| depth-3 paginated | 2.16ms ±0.511 | 2.18ms ±0.223 | — | ~1.00x | ≈ | 37.0% | 50 |
| depth-4 unbound | 6.81ms ±0.379 | 5.58ms ±0.501 | — | 1.22x | ** | 32.4% | 50 |
| depth-4 paginated | 1.82ms ±0.129 | 2.57ms ±0.260 | — | ~1.00x | ≈ | 36.5% | 50 |
| findFirst depth-2 | 2.01ms ±0.222 | 1.46ms ±0.085 | — | ~1.00x | ≈ | 21.0% | 50 |
| findUnique depth-2 Project→tasks→comment | 1.74ms ±0.118 | 2.24ms ±0.173 | — | ~1.00x | ≈ | 27.8% | 50 |
| complex nested select | 4.91ms ±0.514 | 4.10ms ±0.060 | — | ~1.00x | ≈ | 5.3% | 50 |
| ultra deep query | 6.28ms ±0.225 | 6.20ms ±0.194 | — | ~1.00x | ≈ | 11.3% | 50 |
| transaction: (3 operations) | 2.75ms ±0.128 | 1.29ms ±0.049 | — | 2.13x | *** | 13.8% | 50 |
| Test | Prisma | prisma-sql | Drizzle | Speedup | Sig. | CV% | n |
|---|---|---|---|---|---|---|---|
| findMany basic | 1.56ms ±0.236 | 0.323ms ±0.076 | 0.396ms | 4.83x 1.23x D | *** | 84.4% | 50 |
| findMany where = | 1.15ms ±0.101 | 0.462ms ±0.081 | 0.182ms | ~1.00x | ≈ | 63.3% | 50 |
| findMany where >= | 15.55ms ±0.593 | 2.22ms ±0.550 | 2.42ms | 7.01x 1.09x D | *** | 89.6% | 50 |
| findMany where IN | 0.485ms ±0.032 | 0.081ms ±0.019 | 0.130ms | ~1.00x | ≈ | 84.4% | 50 |
| findMany where null | 0.176ms ±0.0067 | 0.023ms ±0.0008 | 0.054ms | ~1.00x | ≈ | 14.9% | 50 |
| findMany AND | 2.16ms ±0.152 | 0.376ms ±0.034 | 0.602ms | 5.75x 1.60x D | *** | 33.0% | 50 |
| findMany OR | 13.09ms ±0.783 | 1.62ms ±0.332 | 2.17ms | 8.08x 1.34x D | *** | 74.0% | 50 |
| findMany NOT | 0.565ms ±0.047 | 0.057ms ±0.0053 | 0.185ms | ~1.00x | ≈ | 33.7% | 50 |
| findMany orderBy | 5.00ms ±0.686 | 6.80ms ±0.872 | 2.07ms | 0.74x 0.31x D | ** | 46.3% | 50 |
| findMany pagination | 0.164ms ±0.015 | 0.036ms ±0.0028 | 0.075ms | ~1.00x | ≈ | 26.6% | 50 |
| findMany select | 0.186ms ±0.011 | 0.265ms ±0.034 | 0.053ms | ~1.00x | ≈ | 46.0% | 50 |
| findMany relation some | 9.08ms ±2.07 | 0.452ms ±0.0072 | — | 20.06x | *** | 5.7% | 50 |
| findMany relation every | 20.39ms ±5.59 | 7.09ms ±0.357 | — | 2.88x | *** | 18.2% | 50 |
| findMany relation none | 193.82ms ±13.64 | 4.09ms ±1.21 | — | 47.35x | *** | 47.8% | 10 |
| findMany nested relation | 1.16ms ±0.033 | 0.336ms ±0.030 | — | ~1.00x | ≈ | 32.6% | 50 |
| findMany complex | 1.53ms ±0.193 | 0.436ms ±0.023 | 0.627ms | 3.52x 1.44x D | *** | 19.1% | 50 |
| findFirst | 0.242ms ±0.049 | 0.051ms ±0.0089 | 0.087ms | ~1.00x | ≈ | 63.5% | 50 |
| findFirst skip | 0.292ms ±0.181 | 0.033ms ±0.0017 | 0.088ms | ~1.00x | ≈ | 16.8% | 50 |
| findUnique id | 0.134ms ±0.013 | 0.024ms ±0.0008 | 0.060ms | ~1.00x | ≈ | 10.5% | 50 |
| findUnique email | 0.160ms ±0.012 | 0.026ms ±0.0006 | 0.074ms | ~1.00x | ≈ | 8.1% | 50 |
| count | 0.152ms ±0.025 | 0.016ms ±0.0025 | 0.016ms | ~1.00x | ≈ | 54.2% | 50 |
| count where | 0.430ms ±0.048 | 0.215ms ±0.033 | 0.192ms | ~1.00x | ≈ | 56.1% | 50 |
| _count via include | 0.675ms ±0.050 | 0.475ms ±0.057 | — | ~1.00x | ≈ | 42.9% | 50 |
| _count via include + relations | 1.16ms ±0.027 | 0.667ms ±0.022 | — | ~1.00x | ≈ | 11.7% | 50 |
| aggregate count | 0.208ms ±0.026 | 0.023ms ±0.0030 | — | ~1.00x | ≈ | 49.6% | 50 |
| aggregate sum/avg | 0.554ms ±0.167 | 0.176ms ±0.016 | — | ~1.00x | ≈ | 31.6% | 50 |
| aggregate where | 0.272ms ±0.014 | 0.189ms ±0.019 | — | ~1.00x | ≈ | 36.3% | 50 |
| aggregate min/max | 0.307ms ±0.012 | 0.176ms ±0.0050 | — | ~1.00x | ≈ | 10.4% | 50 |
| aggregate complete | 0.418ms ±0.015 | 0.248ms ±0.015 | — | ~1.00x | ≈ | 21.4% | 50 |
| groupBy | 0.839ms ±0.097 | 0.478ms ±0.0094 | — | ~1.00x | ≈ | 7.0% | 50 |
| groupBy count | 0.764ms ±0.058 | 0.585ms ±0.066 | — | ~1.00x | ≈ | 40.8% | 50 |
| groupBy multi | 1.58ms ±0.094 | 1.31ms ±0.113 | — | ~1.00x | ≈ | 31.2% | 50 |
| groupBy having | 0.747ms ±0.027 | 0.517ms ±0.011 | — | ~1.00x | ≈ | 7.5% | 50 |
| groupBy + where | 0.479ms ±0.047 | 0.211ms ±0.011 | — | ~1.00x | ≈ | 18.6% | 50 |
| groupBy aggregates | 0.965ms ±0.067 | 0.727ms ±0.063 | — | ~1.00x | ≈ | 31.1% | 50 |
| groupBy min/max | 0.823ms ±0.019 | 0.626ms ±0.015 | — | ~1.00x | ≈ | 8.5% | 50 |
| include posts | 2.12ms ±0.050 | 0.521ms ±0.159 | 1.44ms | 4.06x 2.76x D | *** | 109.8% | 50 |
| include profile | 0.764ms ±0.068 | 0.097ms ±0.018 | 0.229ms | ~1.00x | ≈ | 67.0% | 50 |
| include 3 levels | 1.16ms ±0.044 | 0.762ms ±0.067 | 0.917ms | ~1.00x | ≈ | 31.6% | 50 |
| include 4 levels | 1.36ms ±0.090 | 0.436ms ±0.014 | 1.15ms | ~1.00x | ≈ | 11.8% | 50 |
| include + where | 1.06ms ±0.095 | 0.694ms ±0.097 | 0.433ms | ~1.00x | ≈ | 50.6% | 50 |
| include + select nested | 0.940ms ±0.063 | 0.816ms ±0.186 | 1.15ms | ~1.00x | ≈ | 82.2% | 50 |
| findMany startsWith | 0.234ms ±0.040 | 0.033ms ±0.0019 | 0.077ms | ~1.00x | ≈ | 20.2% | 50 |
| findMany endsWith | 0.719ms ±0.168 | 0.076ms ±0.0075 | 0.147ms | ~1.00x | ≈ | 35.6% | 50 |
| findMany NOT contains | 0.505ms ±0.017 | 0.054ms ±0.0017 | 0.111ms | ~1.00x | ≈ | 10.5% | 50 |
| findMany LIKE | 0.173ms ±0.019 | 0.033ms ±0.0011 | 0.059ms | ~1.00x | ≈ | 11.9% | 50 |
| findMany < | 28.05ms ±3.67 | 3.17ms ±0.724 | 4.05ms | 8.84x 1.28x D | *** | 82.3% | 50 |
| findMany <= | 23.21ms ±0.409 | 3.12ms ±0.607 | 3.81ms | 7.44x 1.22x D | *** | 70.2% | 50 |
| findMany > | 11.78ms ±0.138 | 1.40ms ±0.275 | 1.93ms | 8.43x 1.38x D | *** | 71.0% | 50 |
| findMany NOT IN | 0.410ms ±0.0075 | 0.057ms ±0.0078 | 0.095ms | ~1.00x | ≈ | 49.0% | 50 |
| findMany isNot null | 0.422ms ±0.0064 | 0.049ms ±0.0006 | 0.091ms | ~1.00x | ≈ | 4.8% | 50 |
| orderBy multi-field | 0.667ms ±0.016 | 0.337ms ±0.0028 | 0.377ms | ~1.00x | ≈ | 2.9% | 50 |
| orderBy relation to-one | 0.620ms ±0.0069 | 0.311ms ±0.0067 | — | ~1.00x | ≈ | 7.8% | 50 |
| orderBy relation + scalar | 0.709ms ±0.0094 | 0.383ms ±0.0019 | — | ~1.00x | ≈ | 1.9% | 50 |
| orderBy nullable relation | 0.689ms ±0.085 | 0.333ms ±0.0069 | — | ~1.00x | ≈ | 7.4% | 50 |
| orderBy deep relation | 0.752ms ±0.026 | 0.391ms ±0.0053 | — | ~1.00x | ≈ | 5.0% | 50 |
| orderBy deep relation + scalar | 1.25ms ±0.071 | 0.724ms ±0.021 | — | ~1.00x | ≈ | 10.3% | 50 |
| distinct status | 11.01ms ±0.111 | 4.03ms ±0.014 | — | 2.73x | *** | 1.2% | 50 |
| distinct multi | 12.10ms ±0.120 | 4.92ms ±0.037 | — | 2.46x | *** | 2.7% | 50 |
| select + include | 0.544ms ±0.014 | 0.244ms ±0.0022 | 0.123ms | ~1.00x | ≈ | 3.5% | 50 |
| _count relation | 0.647ms ±0.013 | 0.352ms ±0.0028 | — | ~1.00x | ≈ | 2.9% | 50 |
| _count multi-relation | 0.149ms ±0.0078 | 0.048ms ±0.0030 | — | ~1.00x | ≈ | 22.1% | 50 |
| _count inside include | 0.899ms ±0.020 | 0.531ms ±0.0086 | — | ~1.00x | ≈ | 5.9% | 50 |
| _count inside nested select | 1.55ms ±0.022 | 1.15ms ±0.012 | — | ~1.00x | ≈ | 3.8% | 50 |
| _count deep include | 1.31ms ±0.019 | 0.685ms ±0.0069 | — | ~1.00x | ≈ | 3.6% | 50 |
| findMany Date range | 0.254ms ±0.011 | 0.046ms ±0.0006 | 0.224ms | ~1.00x | ≈ | 4.9% | 50 |
| findMany Date gte | 0.238ms ±0.0053 | 0.045ms ±0.0014 | 0.078ms | ~1.00x | ≈ | 10.1% | 50 |
| depth-1 low-fan Project→labels | 0.237ms ±0.0033 | 0.062ms ±0.0014 | — | ~1.00x | ≈ | 8.4% | 50 |
| depth-1 mid-fan Project→tasks | 1.93ms ±0.059 | 0.344ms ±0.0039 | — | 5.61x | *** | 4.1% | 50 |
| depth-1 high-fan User→assignedTasks | 1.66ms ±0.070 | 0.317ms ±0.0033 | — | 5.22x | *** | 3.8% | 50 |
| depth-1 wide | 1.47ms ±0.061 | 0.319ms ±0.0030 | — | 4.60x | *** | 3.3% | 50 |
| depth-1 no-limit Project→tasks | 34.95ms ±0.842 | 5.67ms ±0.894 | — | 6.17x | *** | 56.9% | 50 |
| depth-2 | 1.92ms ±0.093 | 0.646ms ±0.131 | — | 2.98x | *** | 73.0% | 50 |
| depth-2 paginated | 1.29ms ±0.300 | 0.702ms ±0.017 | — | ~1.00x | ≈ | 8.8% | 50 |
| depth-2 high-fan | 1.72ms ±0.099 | 0.413ms ±0.011 | — | 4.17x | *** | 9.3% | 50 |
| depth-2 wide+attach+activity | 1.94ms ±0.114 | 0.604ms ±0.096 | — | 3.20x | *** | 57.3% | 50 |
| depth-2 no-limit | 53.59ms ±2.54 | 10.60ms ±2.59 | — | 5.06x | *** | 39.4% | 10 |
| depth-3 | 10.47ms ±0.224 | 1.78ms ±0.190 | — | 5.87x | *** | 38.5% | 50 |
| depth-3 paginated | 1.06ms ±0.016 | 0.596ms ±0.0055 | — | ~1.00x | ≈ | 3.4% | 50 |
| depth-4 | 5.67ms ±0.090 | 1.21ms ±0.138 | — | 4.69x | *** | 41.3% | 50 |
| depth-4 paginated | 1.09ms ±0.011 | 0.392ms ±0.0033 | — | ~1.00x | ≈ | 3.0% | 50 |
| findFirst depth-2 | 0.911ms ±0.017 | 0.284ms ±0.0025 | — | ~1.00x | ≈ | 3.2% | 50 |
| findUnique depth-2 | 0.931ms ±0.067 | 0.281ms ±0.0019 | — | ~1.00x | ≈ | 2.4% | 50 |
| Test | Prisma | prisma-sql | Drizzle | Speedup | Sig. | CV% | n |
|---|---|---|---|---|---|---|---|
| findMany basic | 0.214ms ±0.024 | 0.114ms ±0.029 | 1.00ms | ~1.00x | ≈ | 90.2% | 50 |
| findMany where = | 0.481ms ±0.118 | 0.447ms ±0.073 | 0.153ms | ~1.00x | ≈ | 59.0% | 50 |
| findMany where >= | 5.83ms ±0.689 | 3.19ms ±1.09 | 2.54ms | 1.83x 0.80x D | *** | 123.6% | 50 |
| findMany where IN | 0.180ms ±0.025 | 0.052ms ±0.0008 | 0.110ms | ~1.00x | ≈ | 6.5% | 50 |
| findMany where null | 0.069ms ±0.0039 | 0.024ms ±0.0006 | 0.055ms | ~1.00x | ≈ | 9.2% | 50 |
| findMany AND | 0.758ms ±0.136 | 0.344ms ±0.028 | 0.514ms | ~1.00x | ≈ | 29.6% | 50 |
| findMany OR | 4.13ms ±0.545 | 1.79ms ±0.506 | 2.20ms | 2.31x 1.23x D | *** | 102.2% | 50 |
| findMany NOT | 0.323ms ±0.104 | 0.070ms ±0.021 | 0.107ms | ~1.00x | ≈ | 109.5% | 50 |
| findMany orderBy | 1.77ms ±0.044 | 1.71ms ±0.012 | 1.81ms | ~1.00x | ≈ | 2.5% | 50 |
| findMany pagination | 0.078ms ±0.016 | 0.035ms ±0.0011 | 0.063ms | ~1.00x | ≈ | 12.8% | 50 |
| findMany select | 0.061ms ±0.0053 | 0.110ms ±0.110 | 0.041ms | ~1.00x | ≈ | 362.3% | 50 |
| findMany relation some | 0.384ms ±0.0094 | 0.421ms ±0.0028 | — | ~1.00x | ≈ | 2.3% | 50 |
| findMany relation every | 11.22ms ±1.19 | 9.67ms ±1.35 | — | 1.16x | ns | 50.2% | 50 |
| findMany relation none | 134.72ms ±6.79 | 3.26ms ±0.791 | — | 41.27x | *** | 39.1% | 10 |
| findMany nested relation | 0.386ms ±0.014 | 0.361ms ±0.032 | — | ~1.00x | ≈ | 31.5% | 50 |
| findMany complex | 0.500ms ±0.012 | 0.507ms ±0.114 | 0.484ms | ~1.00x | ≈ | 81.3% | 50 |
| findFirst | 0.077ms ±0.011 | 0.025ms ±0.0006 | 0.059ms | ~1.00x | ≈ | 8.8% | 50 |
| findFirst skip | 0.073ms ±0.0017 | 0.027ms ±0.0008 | 0.068ms | ~1.00x | ≈ | 12.9% | 50 |
| findUnique id | 0.067ms ±0.0028 | 0.024ms ±0.0028 | 0.051ms | ~1.00x | ≈ | 43.6% | 50 |
| findUnique email | 0.063ms ±0.0011 | 0.022ms ±0.0003 | 0.048ms | ~1.00x | ≈ | 6.9% | 50 |
| count | 0.035ms ±0.0008 | 0.013ms ±0.0006 | 0.013ms | ~1.00x | ≈ | 11.4% | 50 |
| count where | 0.200ms ±0.011 | 0.160ms ±0.0011 | 0.162ms | ~1.00x | ≈ | 2.8% | 50 |
| _count via include | 0.434ms ±0.0058 | 0.350ms ±0.0019 | — | ~1.00x | ≈ | 1.9% | 50 |
| _count via include + relations | 0.775ms ±0.025 | 0.649ms ±0.028 | — | ~1.00x | ≈ | 15.8% | 50 |
| aggregate count | 0.073ms ±0.0017 | 0.024ms ±0.0006 | — | ~1.00x | ≈ | 9.9% | 50 |
| aggregate sum/avg | 0.211ms ±0.0014 | 0.167ms ±0.0008 | — | ~1.00x | ≈ | 2.0% | 50 |
| aggregate where | 0.211ms ±0.013 | 0.175ms ±0.0072 | — | ~1.00x | ≈ | 14.8% | 50 |
| aggregate min/max | 0.221ms ±0.0078 | 0.174ms ±0.0014 | — | ~1.00x | ≈ | 2.7% | 50 |
| aggregate complete | 0.279ms ±0.0025 | 0.236ms ±0.0014 | — | ~1.00x | ≈ | 2.2% | 50 |
| groupBy | 0.480ms ±0.011 | 0.455ms ±0.0019 | — | ~1.00x | ≈ | 1.6% | 50 |
| groupBy count | 0.484ms ±0.0091 | 0.474ms ±0.011 | — | ~1.00x | ≈ | 8.2% | 50 |
| groupBy multi | 0.995ms ±0.015 | 0.961ms ±0.0050 | — | ~1.00x | ≈ | 1.8% | 50 |
| groupBy having | 1.31ms ±0.481 | 1.05ms ±0.251 | — | ~1.00x | ≈ | 86.4% | 50 |
| groupBy + where | 0.249ms ±0.020 | 0.272ms ±0.031 | — | ~1.00x | ≈ | 41.0% | 50 |
| groupBy aggregates | 0.753ms ±0.054 | 0.738ms ±0.053 | — | ~1.00x | ≈ | 26.2% | 50 |
| groupBy min/max | 0.727ms ±0.052 | 0.689ms ±0.062 | — | ~1.00x | ≈ | 32.4% | 50 |
| include posts | 0.903ms ±0.144 | 0.420ms ±0.020 | 1.47ms | ~1.00x | ≈ | 17.5% | 50 |
| include profile | 0.188ms ±0.027 | 0.084ms ±0.017 | 0.264ms | ~1.00x | ≈ | 75.3% | 50 |
| include 3 levels | 0.643ms ±0.022 | 0.794ms ±0.212 | 1.52ms | ~1.00x | ≈ | 96.2% | 50 |
| include 4 levels | 0.840ms ±0.099 | 0.611ms ±0.078 | 0.683ms | ~1.00x | ≈ | 46.1% | 50 |
| include + where | 0.499ms ±0.111 | 0.309ms ±0.019 | 0.268ms | ~1.00x | ≈ | 22.0% | 50 |
| include + select nested | 0.356ms ±0.013 | 0.315ms ±0.0064 | 1.02ms | ~1.00x | ≈ | 7.2% | 50 |
| findMany startsWith | 0.055ms ±0.0008 | 0.029ms ±0.0003 | 0.064ms | ~1.00x | ≈ | 4.8% | 50 |
| findMany endsWith | 0.159ms ±0.0072 | 0.072ms ±0.0044 | 0.121ms | ~1.00x | ≈ | 21.9% | 50 |
| findMany NOT contains | 0.145ms ±0.0011 | 0.056ms ±0.0008 | 0.163ms | ~1.00x | ≈ | 4.6% | 50 |
| findMany LIKE | 0.057ms ±0.0008 | 0.030ms ±0.0006 | 0.055ms | ~1.00x | ≈ | 6.0% | 50 |
| findMany < | 8.45ms ±0.996 | 3.22ms ±0.723 | 4.29ms | 2.62x 1.33x D | *** | 80.9% | 50 |
| findMany <= | 10.43ms ±1.12 | 4.72ms ±1.09 | 4.55ms | 2.21x 0.96x D | *** | 83.5% | 50 |
| findMany > | 5.15ms ±0.672 | 1.56ms ±0.279 | 2.33ms | 3.31x 1.50x D | *** | 64.6% | 50 |
| findMany NOT IN | 0.157ms ±0.011 | 0.053ms ±0.0011 | 0.108ms | ~1.00x | ≈ | 6.8% | 50 |
| findMany isNot null | 0.190ms ±0.090 | 0.055ms ±0.0011 | 0.103ms | ~1.00x | ≈ | 7.0% | 50 |
| orderBy multi-field | 0.619ms ±0.049 | 0.572ms ±0.103 | 0.448ms | ~1.00x | ≈ | 64.8% | 50 |
| orderBy relation to-one | 0.499ms ±0.049 | 0.488ms ±0.066 | — | ~1.00x | ≈ | 49.0% | 50 |
| orderBy relation + scalar | 0.674ms ±0.145 | 0.465ms ±0.021 | — | ~1.00x | ≈ | 16.7% | 50 |
| orderBy nullable relation | 0.410ms ±0.016 | 0.468ms ±0.067 | — | ~1.00x | ≈ | 51.4% | 50 |
| orderBy deep relation | 0.452ms ±0.011 | 0.527ms ±0.274 | — | ~1.00x | ≈ | 187.5% | 50 |
| orderBy deep relation + scalar | 0.755ms ±0.0097 | 0.698ms ±0.011 | — | ~1.00x | ≈ | 5.5% | 50 |
| distinct status | 7.32ms ±0.285 | 4.41ms ±0.039 | — | 1.66x | *** | 3.2% | 50 |
| distinct multi | 7.01ms ±0.164 | 5.36ms ±0.054 | — | 1.31x | *** | 3.6% | 50 |
| select + include | 0.340ms ±0.019 | 0.270ms ±0.011 | 0.135ms | ~1.00x | ≈ | 15.0% | 50 |
| _count relation | 0.398ms ±0.012 | 0.386ms ±0.039 | — | ~1.00x | ≈ | 36.8% | 50 |
| _count multi-relation | 0.089ms ±0.0030 | 0.044ms ±0.0008 | — | ~1.00x | ≈ | 7.2% | 50 |
| _count inside include | 0.871ms ±0.175 | 0.533ms ±0.0080 | — | ~1.00x | ≈ | 5.4% | 50 |
| _count inside nested select | 1.49ms ±0.077 | 1.36ms ±0.078 | — | ~1.00x | ≈ | 20.7% | 50 |
| _count deep include | 1.06ms ±0.032 | 0.844ms ±0.112 | — | ~1.00x | ≈ | 47.7% | 50 |
| findMany Date range | 0.113ms ±0.011 | 0.048ms ±0.0006 | 0.311ms | ~1.00x | ≈ | 4.3% | 50 |
| findMany Date gte | 0.087ms ±0.0017 | 0.046ms ±0.0014 | 0.083ms | ~1.00x | ≈ | 10.3% | 50 |
| depth-1 low-fan Project→labels | 0.117ms ±0.0017 | 0.064ms ±0.0017 | — | ~1.00x | ≈ | 8.8% | 50 |
| depth-1 mid-fan Project→tasks | 0.811ms ±0.136 | 0.418ms ±0.127 | — | ~1.00x | ≈ | 109.2% | 50 |
| depth-1 high-fan User→assignedTasks | 0.762ms ±0.197 | 0.338ms ±0.013 | — | ~1.00x | ≈ | 13.8% | 50 |
| depth-1 wide | 0.783ms ±0.243 | 0.369ms ±0.013 | — | ~1.00x | ≈ | 12.4% | 50 |
| depth-1 no-limit Project→tasks | 13.14ms ±1.13 | 5.79ms ±1.13 | — | 2.27x | *** | 70.5% | 50 |
| depth-2 | 0.944ms ±0.162 | 0.566ms ±0.040 | — | ~1.00x | ≈ | 25.9% | 50 |
| depth-2 paginated | 0.519ms ±0.018 | 0.693ms ±0.040 | — | ~1.00x | ≈ | 21.1% | 50 |
| depth-2 high-fan | 0.712ms ±0.019 | 0.475ms ±0.127 | — | ~1.00x | ≈ | 96.0% | 50 |
| depth-2 wide+attach+activity | 1.08ms ±0.111 | 0.634ms ±0.034 | — | ~1.00x | ≈ | 19.5% | 50 |
| depth-2 no-limit | 19.15ms ±1.16 | 9.17ms ±0.738 | — | 2.09x | *** | 29.0% | 50 |
| depth-3 | 3.66ms ±0.277 | 1.81ms ±0.247 | — | 2.02x | *** | 49.0% | 50 |
| depth-3 paginated | 0.654ms ±0.026 | 0.667ms ±0.036 | — | ~1.00x | ≈ | 19.6% | 50 |
| depth-4 | 2.27ms ±0.244 | 1.16ms ±0.157 | — | 1.96x | *** | 48.6% | 50 |
| depth-4 paginated | 0.674ms ±0.022 | 0.391ms ±0.015 | — | ~1.00x | ≈ | 13.6% | 50 |
| findFirst depth-2 | 0.569ms ±0.139 | 0.298ms ±0.0047 | — | ~1.00x | ≈ | 5.6% | 50 |
| findUnique depth-2 | 0.513ms ±0.020 | 0.303ms ±0.012 | — | ~1.00x | ≈ | 13.7% | 50 |
| Test | Prisma | prisma-sql | Drizzle | Speedup | Sig. | CV% | n |
|---|---|---|---|---|---|---|---|
| findMany basic | 0.369ms ±0.356 | 0.067ms ±0.0044 | 0.144ms | ~1.00x | ≈ | 23.3% | 50 |
| findMany where = | 0.135ms ±0.0050 | 0.053ms ±0.0014 | 0.105ms | ~1.00x | ≈ | 8.8% | 50 |
| findMany where >= | 4.75ms ±0.587 | 2.22ms ±0.682 | 2.67ms | 2.14x 1.20x D | *** | 111.1% | 50 |
| findMany where IN | 0.850ms ±0.430 | 0.083ms ±0.021 | 0.357ms | ~1.00x | ≈ | 89.7% | 50 |
| findMany where null | 0.072ms ±0.0050 | 0.035ms ±0.0080 | 0.054ms | ~1.00x | ≈ | 82.2% | 50 |
| findMany AND | 0.660ms ±0.114 | 0.323ms ±0.0064 | 0.441ms | ~1.00x | ≈ | 7.1% | 50 |
| findMany OR | 3.83ms ±0.610 | 1.36ms ±0.239 | 2.16ms | 2.80x 1.59x D | *** | 63.2% | 50 |
| findMany NOT | 0.189ms ±0.035 | 0.113ms ±0.039 | 0.122ms | ~1.00x | ≈ | 125.5% | 50 |
| findMany orderBy | 1.78ms ±0.014 | 1.79ms ±0.030 | 1.73ms | ~1.00x | ≈ | 6.1% | 50 |
| findMany pagination | 0.076ms ±0.0097 | 0.036ms ±0.0019 | 0.059ms | ~1.00x | ≈ | 20.8% | 50 |
| findMany select | 0.061ms ±0.0044 | 0.060ms ±0.0089 | 0.041ms | ~1.00x | ≈ | 53.2% | 50 |
| findMany relation some | 0.390ms ±0.0089 | 0.481ms ±0.110 | — | ~1.00x | ≈ | 82.2% | 50 |
| findMany relation every | 9.98ms ±0.085 | 6.70ms ±0.113 | — | 1.49x | *** | 6.1% | 50 |
| findMany relation none | 140.85ms ±9.84 | 4.81ms ±1.08 | — | 29.29x | *** | 25.6% | 5 |
| findMany nested relation | 0.426ms ±0.020 | 0.584ms ±0.377 | — | ~1.00x | ≈ | 232.9% | 50 |
| findMany complex | 0.515ms ±0.014 | 0.456ms ±0.0067 | 0.489ms | ~1.00x | ≈ | 5.2% | 50 |
| findFirst | 0.078ms ±0.017 | 0.026ms ±0.0022 | 0.063ms | ~1.00x | ≈ | 30.0% | 50 |
| findFirst skip | 0.078ms ±0.0058 | 0.028ms ±0.0008 | 0.070ms | ~1.00x | ≈ | 9.7% | 50 |
| findUnique id | 0.065ms ±0.0039 | 0.022ms ±0.0006 | 0.048ms | ~1.00x | ≈ | 11.1% | 50 |
| findUnique email | 0.064ms ±0.0011 | 0.023ms ±0.0006 | 0.048ms | ~1.00x | ≈ | 6.7% | 50 |
| count | 0.035ms ±0.0011 | 0.014ms ±0.0006 | 0.013ms | ~1.00x | ≈ | 15.9% | 50 |
| count where | 0.212ms ±0.0100 | 0.165ms ±0.0019 | 0.168ms | ~1.00x | ≈ | 4.1% | 50 |
| _count via include | 0.591ms ±0.236 | 0.357ms ±0.010 | — | ~1.00x | ≈ | 10.4% | 50 |
| _count via include + relations | 0.928ms ±0.129 | 0.749ms ±0.075 | — | ~1.00x | ≈ | 36.2% | 50 |
| aggregate count | 0.080ms ±0.0058 | 0.023ms ±0.0008 | — | ~1.00x | ≈ | 14.0% | 50 |
| aggregate sum/avg | 0.232ms ±0.012 | 0.190ms ±0.028 | — | ~1.00x | ≈ | 53.0% | 50 |
| aggregate where | 0.211ms ±0.0091 | 0.170ms ±0.0036 | — | ~1.00x | ≈ | 7.5% | 50 |
| aggregate min/max | 0.238ms ±0.012 | 0.180ms ±0.0033 | — | ~1.00x | ≈ | 6.6% | 50 |
| aggregate complete | 0.340ms ±0.026 | 0.262ms ±0.0089 | — | ~1.00x | ≈ | 12.2% | 50 |
| groupBy | 0.513ms ±0.023 | 0.586ms ±0.063 | — | ~1.00x | ≈ | 38.5% | 50 |
| groupBy count | 0.537ms ±0.022 | 0.477ms ±0.0044 | — | ~1.00x | ≈ | 3.3% | 50 |
| groupBy multi | 1.16ms ±0.150 | 1.06ms ±0.038 | — | ~1.00x | ≈ | 13.0% | 50 |
| groupBy having | 0.555ms ±0.022 | 0.622ms ±0.058 | — | ~1.00x | ≈ | 33.8% | 50 |
| groupBy + where | 0.230ms ±0.0086 | 0.205ms ±0.0047 | — | ~1.00x | ≈ | 8.1% | 50 |
| groupBy aggregates | 0.617ms ±0.012 | 0.585ms ±0.0083 | — | ~1.00x | ≈ | 5.2% | 50 |
| groupBy min/max | 0.687ms ±0.024 | 0.650ms ±0.028 | — | ~1.00x | ≈ | 15.6% | 50 |
| include posts | 1.05ms ±0.193 | 0.398ms ±0.012 | 2.10ms | ~1.00x | ≈ | 10.8% | 50 |
| include profile | 0.170ms ±0.015 | 0.091ms ±0.014 | 0.299ms | ~1.00x | ≈ | 55.8% | 50 |
| include 3 levels | 0.742ms ±0.074 | 0.629ms ±0.018 | 0.805ms | ~1.00x | ≈ | 10.3% | 50 |
| include 4 levels | 1.15ms ±0.133 | 0.546ms ±0.149 | 0.664ms | ~1.00x | ≈ | 98.5% | 50 |
| include + where | 0.538ms ±0.112 | 0.324ms ±0.018 | 0.329ms | ~1.00x | ≈ | 20.2% | 50 |
| include + select nested | 0.435ms ±0.073 | 0.350ms ±0.012 | 1.13ms | ~1.00x | ≈ | 12.4% | 50 |
| findMany startsWith | 0.081ms ±0.018 | 0.031ms ±0.0006 | 0.058ms | ~1.00x | ≈ | 5.3% | 50 |
| findMany endsWith | 0.166ms ±0.011 | 0.079ms ±0.0055 | 0.133ms | ~1.00x | ≈ | 24.7% | 50 |
| findMany NOT contains | 0.233ms ±0.162 | 0.055ms ±0.0008 | 0.102ms | ~1.00x | ≈ | 5.5% | 50 |
| findMany LIKE | 0.057ms ±0.0011 | 0.032ms ±0.0006 | 0.051ms | ~1.00x | ≈ | 7.1% | 50 |
| findMany < | 7.28ms ±0.437 | 4.05ms ±1.32 | 4.26ms | 1.80x 1.05x D | *** | 117.4% | 50 |
| findMany <= | 8.20ms ±0.697 | 3.38ms ±0.667 | 4.12ms | 2.43x 1.22x D | *** | 71.3% | 50 |
| findMany > | 6.03ms ±0.993 | 2.55ms ±0.567 | 2.63ms | 2.36x 1.03x D | *** | 80.2% | 50 |
| findMany NOT IN | 0.177ms ±0.016 | 0.216ms ±0.088 | 0.189ms | ~1.00x | ≈ | 147.4% | 50 |
| findMany isNot null | 0.172ms ±0.024 | 0.079ms ±0.016 | 0.155ms | ~1.00x | ≈ | 72.7% | 50 |
| orderBy multi-field | 0.550ms ±0.049 | 1.00ms ±0.214 | 0.513ms | ~1.00x | ≈ | 76.9% | 50 |
| orderBy relation to-one | 0.551ms ±0.074 | 0.731ms ±0.180 | — | ~1.00x | ≈ | 88.7% | 50 |
| orderBy relation + scalar | 0.528ms ±0.035 | 0.448ms ±0.023 | — | ~1.00x | ≈ | 18.8% | 50 |
| orderBy nullable relation | 0.723ms ±0.278 | 0.503ms ±0.078 | — | ~1.00x | ≈ | 56.1% | 50 |
| orderBy deep relation | 0.497ms ±0.021 | 0.510ms ±0.068 | — | ~1.00x | ≈ | 48.3% | 50 |
| orderBy deep relation + scalar | 0.987ms ±0.235 | 1.12ms ±0.112 | — | ~1.00x | ≈ | 36.3% | 50 |
| distinct status | 6.22ms ±0.133 | 4.45ms ±0.037 | — | 1.40x | *** | 3.0% | 50 |
| distinct multi | 7.14ms ±0.397 | 5.72ms ±0.082 | — | 1.25x | *** | 5.2% | 50 |
| select + include | 0.322ms ±0.016 | 0.276ms ±0.0097 | 0.123ms | ~1.00x | ≈ | 12.7% | 50 |
| _count relation | 0.463ms ±0.128 | 0.349ms ±0.0033 | — | ~1.00x | ≈ | 3.5% | 50 |
| _count multi-relation | 0.101ms ±0.0080 | 0.048ms ±0.0036 | — | ~1.00x | ≈ | 26.6% | 50 |
| _count inside include | 0.645ms ±0.026 | 0.755ms ±0.166 | — | ~1.00x | ≈ | 79.1% | 50 |
| _count inside nested select | 1.27ms ±0.045 | 1.24ms ±0.032 | — | ~1.00x | ≈ | 9.3% | 50 |
| _count deep include | 1.15ms ±0.045 | 0.787ms ±0.042 | — | ~1.00x | ≈ | 19.1% | 50 |
| findMany Date range | 0.106ms ±0.0069 | 0.113ms ±0.109 | 0.330ms | ~1.00x | ≈ | 351.1% | 50 |
| findMany Date gte | 0.087ms ±0.0011 | 0.048ms ±0.0017 | 0.083ms | ~1.00x | ≈ | 13.1% | 50 |
| depth-1 low-fan Project→labels | 0.120ms ±0.0050 | 0.068ms ±0.0025 | — | ~1.00x | ≈ | 13.6% | 50 |
| depth-1 mid-fan Project→tasks | 0.987ms ±0.173 | 0.375ms ±0.0058 | — | ~1.00x | ≈ | 5.7% | 50 |
| depth-1 high-fan User→assignedTasks | 1.01ms ±0.309 | 0.796ms ±0.162 | — | ~1.00x | ≈ | 73.6% | 50 |
| depth-1 wide | 0.807ms ±0.164 | 0.452ms ±0.062 | — | ~1.00x | ≈ | 49.9% | 50 |
| depth-1 no-limit Project→tasks | 12.51ms ±1.15 | 5.53ms ±0.972 | — | 2.26x | *** | 63.4% | 50 |
| depth-2 | 0.853ms ±0.041 | 0.847ms ±0.222 | — | ~1.00x | ≈ | 94.4% | 50 |
| depth-2 paginated | 0.917ms ±0.276 | 1.00ms ±0.102 | — | ~1.00x | ≈ | 36.6% | 50 |
| depth-2 high-fan | 0.993ms ±0.205 | 0.514ms ±0.051 | — | ~1.00x | ≈ | 35.6% | 50 |
| depth-2 wide+attach+activity | 1.23ms ±0.164 | 0.659ms ±0.129 | — | ~1.00x | ≈ | 70.6% | 50 |
| depth-2 no-limit | 22.46ms ±2.45 | 9.88ms ±0.645 | — | 2.27x | *** | 23.5% | 50 |
| depth-3 | 4.31ms ±0.386 | 2.60ms ±0.611 | — | 1.66x | *** | 84.9% | 50 |
| depth-3 paginated | 0.745ms ±0.164 | 0.646ms ±0.060 | — | ~1.00x | ≈ | 33.3% | 50 |
| depth-4 | 2.84ms ±0.356 | 1.54ms ±0.284 | — | 1.84x | *** | 66.5% | 50 |
| depth-4 paginated | 0.793ms ±0.141 | 0.450ms ±0.027 | — | ~1.00x | ≈ | 21.6% | 50 |
| findFirst depth-2 | 0.733ms ±0.123 | 0.304ms ±0.013 | — | ~1.00x | ≈ | 15.1% | 50 |
| findUnique depth-2 | 0.585ms ±0.144 | 0.346ms ±0.040 | — | ~1.00x | ≈ | 41.5% | 50 |
npm run bench (BENCHMARK_JSON_OUTPUT=1 writes JSON). Results land in benchmark-results/summary-.json ; v--latest.json feeds this page. Bypass Prisma's read execution path while keeping Prisma's API and types
Extension catches read operations (findMany, findFirst, findUnique, count, aggregate, groupBy) before they execute
Convert Prisma queries into fast, parameterized SQL with optimized JOINs
Run queries through postgres.js or better-sqlite3, bypassing Prisma read overhead
Results match Prisma's expected shape. Types, IntelliSense, and existing query code remain unchanged
const users = await prisma.user.findMany({
where: { status: 'ACTIVE' },
include: { posts: true }
})
// Direct SQL execution for reads
// Benchmarked around ~1.00ms on this workload
// Same Prisma query code Get raw SQL execution speed for reads while keeping Prisma's developer experience
One-time setup accelerates Prisma reads. No refactoring, no migration, no downtime.
Full TypeScript support maintained. Type inference, autocomplete, and compile-time safety preserved while accelerating reads.
Current parity tests validate supported reads across recent Prisma versions. Use it for production apps after checking compatibility with your Prisma version and workload.
Optimize Prisma reads on PostgreSQL (including Neon, Supabase) and SQLite.
Optional generator creates build-time SQL, reducing overhead to microseconds for your hottest queries.
Works in serverless Node runtimes. Edge runtime support depends on runtime constraints and the driver you use.
prisma-sql adds capabilities Prisma Client does not have. Same types, same code style.
N dashboard queries, one round trip
Combine independent reads into a single PostgreSQL round trip. Typed object result, no Promise.all juggling.
const dash = await prisma.$batch((b) => ({
users: b.user.count(),
posts: b.post.findMany({ take: 10 }),
stats: b.task.aggregate({ _count: true }),
})) Prebake your hottest queries
Annotate a model in schema.prisma. At generate time the exact SQL is baked; matching runtime shapes skip conversion completely.
/// @optimize {
/// "method": "findMany",
/// "query": {
/// "where": { "status": "$status" },
/// "take": "$take"
/// }
/// }
model User { ... } Strategy chosen by data, not by guess
Collected relation stats drive strategy switching between flat joins, correlated subqueries and where-in segmented loading. Large child tables never trigger per-parent scans.
prisma-sql-collect-stats \
--output dist/planner.generated.js \
--prisma-client dist/client/index.js Common scenarios where this extension makes a real difference
Prisma aggregations and groupBy operations benefit significantly from direct SQL execution
Per-query overhead compounds under load, especially on read-heavy endpoints
Every millisecond matters in serverless: reduce read latency where it counts
Users notice latency: faster reads improve perceived UX immediately
Accelerate Prisma reads in under 60 seconds
# PostgreSQL
npm install prisma-sql postgres
# SQLite
npm install prisma-sql better-sqlite3 import { PrismaClient, Prisma } from '@prisma/client'
import { speedExtension, convertDMMFToModels } from 'prisma-sql'
import postgres from 'postgres'
const sql = postgres(process.env.DATABASE_URL)
const models = convertDMMFToModels(Prisma.dmmf.datamodel)
const prisma = new PrismaClient().$extends(
speedExtension({ postgres: sql, models })
) const users = await prisma.user.findMany({
where: { status: 'ACTIVE' },
include: { posts: true }
}) Common questions about optimizing Prisma reads
Prisma adds overhead because it implements API guarantees like schema-based validation, consistent query behavior, and result shaping. Those layers provide a great developer experience but cost time compared to executing raw SQL directly.
Optimize read-heavy Prisma workloads by adding this extension. It executes read operations via direct SQL using postgres.js or better-sqlite3 while keeping Prisma's API and types. Setup is a small initialization change and does not require refactoring your existing queries.
For many read workloads, yes. There is architectural overhead compared to raw SQL execution. This extension aims to keep Prisma's DX while reducing read latency by executing SQL directly.
Yes. Add the extension once during Prisma Client initialization and keep your existing Prisma query code unchanged. Read operations run faster while your Prisma API, types, and schema remain the same.
Yes, it is designed for production use on supported read paths. Always verify compatibility with your Prisma version and run your own regression tests before rollout.
Aggregations and groupBy often amplify fixed overhead (query processing and result shaping) and can involve larger intermediate result sets. This extension optimizes those reads by generating SQL directly, which typically reduces latency on aggregation-heavy endpoints.
Check the current benchmark table for supported PostgreSQL and SQLite reads