Rich schema vs query performance
Le problème
Cars link to brands, models, categories, features, and rentals—naive joins caused slow browse queries.
Comment je l'ai résolu
Used Drizzle relational queries with selective columns and indexed foreign keys.
const cars = await db.query.cars.findMany({
where: and(eq(cars.available, true)),
with: { model: { with: { brand: true } } },
limit: 20,
});

