Prisma optimization

Hi everyone, i have a postgresql db with a table named Pricing, it contains arouned 35 columns (string and numbers), + and id, an enum and an index for the company_id related, without one to one relation For one specific company_id, it gives me around 1 milllions rows that i have to display on my frontend (100 per 100 with the pagination) My problem is that it lasts at least 1 min to display the data, it's too much, any idea how to improve the db ? Ps: with another company_id related to 10 000 rows, the data appears instantly Thanks
model Pricing {
id Int @id @default(autoincrement())
CATEGORY_FINAL String?
TITLE String?
-- 30 more columns --

likeStatus LikeStatus?

@@index(fields: [company_id, ID_SNOW, ID_CONCURRENT], map: "idx_pricing_company_id")
@@map("pricings")
}
model Pricing {
id Int @id @default(autoincrement())
CATEGORY_FINAL String?
TITLE String?
-- 30 more columns --

likeStatus LikeStatus?

@@index(fields: [company_id, ID_SNOW, ID_CONCURRENT], map: "idx_pricing_company_id")
@@map("pricings")
}
1 Reply
jonfanz
jonfanz7mo ago
Could you please post the query you are running as well?
Want results from more Discord servers?
Add your server