Always explicitly select only the database fields you actually need instead of using broad includes or fetching entire objects. This practice significantly improves query performance, reduces memory usage, and minimizes data exposure.

Why this matters:

How to apply:

Instead of fetching everything:

// โŒ Avoid - fetches all fields
const booking = await prisma.booking.findUnique({
  where: { uid: bookingUid },
  include: {
    attendees: true,
    user: true,
    eventType: {
      include: {
        owner: true,
      }
    }
  }
});

Be specific about what you need:

// โœ… Better - select only required fields
const booking = await prisma.booking.findUnique({
  where: { uid: bookingUid },
  include: {
    attendees: {
      select: {
        id: true,
        email: true,
        name: true
      }
    },
    user: {
      select: {
        id: true,
        name: true
      }
    },
    eventType: {
      select: {
        id: true,
        title: true
      }
    }
  }
});

Special considerations: