Performance problems are rarely caused by one bad query. They come from accumulation: an unoptimised hero image, six analytics scripts, a carousel library shipping 80kb of JavaScript for a five-second animation.
Set a performance budget during design. Decide the largest allowed hero image, the script budget per page and the Core Web Vitals you will hold yourself to. Then treat exceeding the budget as a design change, not an engineering task.
Teams that do this ship faster sites because the constraint shapes the design early, when changing it is still cheap.