LLM solves this by meeting devs in the middle: the vibe coded DB schema, coupled with agentically-made application code, makes even 20,000 records a "huge scale".
Schema design and query design will make or break your app’s ability to scale without skyrocketing the bill, it’s as simple as that.
This one is a classic for MSSQL, most of it is applicable on postgres.