r/SQL • • May 20 '26

PostgreSQL What are common SQL red flags?

Hello! interview prepping, here wondering what are some common red flags for wrioting SQL?

Like

LIKE failing to index, not having trasnactions, usign SELECT * instead of specific collums, etc 😃

51 Upvotes

192 comments sorted by

View all comments

Show parent comment

9

u/fauxmosexual NOLOCK is the secret magic go-faster command May 20 '26

You should use the correct join for the aituation. A left join where an inner join would work can cause the optimiser to miss the optimal execution plan.

4

u/Andfaxle May 20 '26

Yep, 100% left join is not always the best