# Performance Optimization — NestJS: Building Scalable Node.js APIs

Source: https://www.skillbyai.com/en/nestjs/nestjs-performance

> Speed up NestJS apps by selecting only needed columns, adding indexes, batching queries and avoiding N+1 loads.

## Query optimization

Use `select` to fetch only needed columns; use `indices` in the DB; batch queries where possible.

## N+1 problem

Avoid loading related entities in a loop—use `leftJoinAndSelect()` or batch loaders to fetch all at once.
