In general, are there any performance losses using...
# orm-help
a
In general, are there any performance losses using findMany vs findUnique? I am building some dynamic tooling and an thinking of using findMany for every query since it can return one or multiple based on the where clause.
h
Hey AJ 👋 I would suggesting using the one suits your use case. If you only need a single record,
findMany
is simply redundant, although if you need multiple records that's where it comes in place. If you don't exactly want to search by a primary key and want only a single record, I suggest
findFirst
. In terms of performance,
findUnique
is of course faster even if you search by a secondary index instead of a primary one.