DEV Community

Discussion on: It's Prisma Time - Pagination

 
neeshsamsi profile image
Neesh Samsi

The second was what I was thinking of but apparently offset method is not that good for larger databases. I doubt I would hit those issues but incase I do will it just be slow or will it error out

Thread Thread
 
puppo profile image
Luca Del Puppo

Probably if you are using the offset method and you have more filters your where clause can generate problems. In these cases, you need to check the indexes of the tables used in your queries. In the common cases the skip and take handling in the database doesn't generate any problems of the slowness, but the where clause yes.

Thread Thread
 
neeshsamsi profile image
Neesh Samsi

Thanks, that helps a ton, I have no where and just 1 orderBy so Offset is going to be the way I go!