|
| 1 | +--- |
| 2 | +title: "Prisma ORM v7.4.0: Prisma Client query caching and partial indexes" |
| 3 | +date: "2026-02-11" |
| 4 | +version: "v7.4.0" |
| 5 | +slug: "2026-02-11" |
| 6 | +headline: "Prisma ORM v7.4.0: Prisma Client query caching and partial indexes" |
| 7 | +tags: |
| 8 | + - "Prisma ORM" |
| 9 | +canonical: "/changelog#log2026-02-11" |
| 10 | +share: |
| 11 | + active: true |
| 12 | + content: "Look at this page: " |
| 13 | +source: |
| 14 | + exportedAt: "2026-04-14T00:00:00.000Z" |
| 15 | +--- |
| 16 | + |
| 17 | +## Prisma ORM v7.4.0: Prisma Client query caching and partial indexes |
| 18 | + |
| 19 | +## Highlights |
| 20 | + |
| 21 | +## ORM |
| 22 | + |
| 23 | +### Caching in Prisma Client |
| 24 | + |
| 25 | +Prisma ORM v7.4.0 introduces a new caching layer for Prisma Client. In Prisma 7, the query compiler runs as a WebAssembly module directly on the JavaScript main thread. While that simplified the architecture, it also meant that every query compilation could synchronously block the event loop. |
| 26 | + |
| 27 | +The new cache normalizes query shapes by extracting user-provided values and replacing them with typed placeholders. That lets Prisma reuse compiled plans for repeated queries with the same shape instead of recompiling them every time. |
| 28 | + |
| 29 | +```text |
| 30 | +// These two queries have the same shape: |
| 31 | +const alice = await prisma.user.findUnique({ where: { email: 'alice@prisma.io' } }) |
| 32 | +const bob = await prisma.user.findUnique({ where: { email: 'bob@prisma.io' } }) |
| 33 | +``` |
| 34 | + |
| 35 | +```text |
| 36 | +prisma.user.findUnique({ where: { email: %1 } }) // cache key |
| 37 | + ^ |
| 38 | + %1 = 'alice@prisma.io' (or 'bob@prisma.io') |
| 39 | +``` |
| 40 | + |
| 41 | +On the first call, the query is compiled as usual and the resulting plan is stored in an LRU cache. On subsequent calls with the same query shape, the cached plan is reused instantly without invoking the compiler again. |
| 42 | + |
| 43 | +### Partial Indexes support |
| 44 | + |
| 45 | +Prisma ORM v7.4.0 also adds support for **Partial Indexes** behind the `partialIndexes` preview feature for PostgreSQL, SQLite, SQL Server, and CockroachDB, with migration and introspection support included. |
| 46 | + |
| 47 | +Enable the preview feature in your schema: |
| 48 | + |
| 49 | +```text |
| 50 | +generator client { |
| 51 | + provider = "prisma-client-js" |
| 52 | + previewFeatures = ["partialIndexes"] |
| 53 | +} |
| 54 | +``` |
| 55 | + |
| 56 | +For maximum flexibility, you can use `raw()` with a database-specific predicate: |
| 57 | + |
| 58 | +```text |
| 59 | +model User { |
| 60 | + id Int @id |
| 61 | + email String |
| 62 | + status String |
| 63 | +
|
| 64 | + @@unique([email], where: raw("status = 'active'")) |
| 65 | + @@index([email], where: raw("deletedAt IS NULL")) |
| 66 | +} |
| 67 | +``` |
| 68 | + |
| 69 | +For simpler conditions, you can also use the type-safe object syntax: |
| 70 | + |
| 71 | +```text |
| 72 | +model Post { |
| 73 | + id Int @id |
| 74 | + title String |
| 75 | + published Boolean |
| 76 | +
|
| 77 | + @@index([title], where: { published: true }) |
| 78 | + @@unique([title], where: { published: { not: false } }) |
| 79 | +} |
| 80 | +``` |
| 81 | + |
| 82 | +### Bug fixes |
| 83 | + |
| 84 | +This release also includes a set of fixes from Prisma and community contributors: |
| 85 | + |
| 86 | +- [prisma-engines#5767](https://github.com/prisma/prisma-engines/pull/5767): Fixed PostgreSQL migration scripts to allow `CREATE INDEX CONCURRENTLY` |
| 87 | +- [prisma-engines#5752](https://github.com/prisma/prisma-engines/pull/5752): Fixed BigInt precision loss in JSON aggregation for MySQL and CockroachDB |
| 88 | +- [prisma-engines#5750](https://github.com/prisma/prisma-engines/pull/5750): Fixed connection failures with non-ASCII database names |
| 89 | +- [#29155](https://github.com/prisma/prisma/pull/29155): Fixed silent transaction commit errors in the PlanetScale adapter |
| 90 | +- [#29141](https://github.com/prisma/prisma/pull/29141): Resolved SQL Server adapter race condition errors during commit and rollback |
| 91 | +- [#29158](https://github.com/prisma/prisma/pull/29158): Fixed MSSQL connection string parsing for passwords with curly braces |
| 92 | + |
| 93 | +## Enterprise support |
| 94 | + |
| 95 | +Thousands of teams use Prisma and many of them already tap into our Enterprise & Agency Support Program for hands-on help with everything from schema integrations and performance tuning to security and compliance. |
| 96 | + |
| 97 | +With this program you also get priority issue triage and bug fixes, expert scalability advice, and custom training so that your Prisma-powered apps stay rock-solid at any scale. Learn more or join: [https://prisma.io/enterprise](https://prisma.io/enterprise). |
0 commit comments