Why does this SQL subquery run a thousand times?

Why does this SQL subquery run a thousand times in production. The SQL code uses a correlated subquery in SELECT. In MySQL it executes once per row. In SQL one query can become millions of executions.

#whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqlcorrelatedsubquery #...

https://www.youtube.com/watch?v=HDQwetsWSX4

Why does this SQL subquery run a thousand times? #sqldebugging

YouTube