Query optimization is not compatible with PostgreSQL citext fields #24209
Labels
kind/improvement
An improvement to existing feature and code.
team/client
Issue for team Client.
topic: batching
topic: @db.Citext
Native type `Citext`
topic: findUnique()
topic: performance
Bug description
As for https://www.prisma.io/docs/orm/prisma-client/queries/query-optimization-performance#solving-n1-in-graphql-with-findunique-and-prisma-clients-dataloader, the prisma engine will optimize multiple
findUnique
queries that happen in the same tick by batching the requests into a single query. This is a problem when a postgres model includes acitext
field, which is case insensitive when applying the=
SQL operator, but not when using thein
operator.How to reproduce
Will attach a minimal reproducible example as soon as I have some time.
Expected behavior
Ideally,
findUnique
will disable the optimization only forcitext
fields.Prisma information
Will attach a minimal reproducible example as soon as I have some time.
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: