fix(db): add missing indexes, bound unbounded queries, parallelize admin queries
- Add 7 missing indexes: User(kycStatus, isActive, createdAt), Listing(createdAt, featuredUntil, expiresAt), Payment(createdAt) - Add take:50 limit to unbounded findMediaByPropertyId and findByPropertyId - Parallelize sequential queries in getUserDetail with Promise.all Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -17,6 +17,7 @@ export class PrismaValuationRepository implements IValuationRepository {
|
||||
const records = await this.prisma.valuation.findMany({
|
||||
where: { propertyId },
|
||||
orderBy: { createdAt: 'desc' },
|
||||
take: 50,
|
||||
});
|
||||
return records.map((r) => this.toDomain(r));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user