"🗄️ DB Tip of the Day: Optimize queries with subqueries by rewriting them as JOINs or using CTEs (Common Table Expressions) for better performance 🔍 #SQLPerformance"
"🗄️ DB Tip of the Day: Use query caching to improve performance by reusing previously executed queries, reducing response times and system load 📋 #SQLPerformance"
"🗄️ DB Tip of the Day: Use query profiling tools like SQL Profiler, EXPLAIN, and EXPLAIN ANALYZE to identify slow queries and optimize performance ⏱️ #SQLPerformance"
"🗄️ DB Tip of the Day: Use query hints and optimizer directives judiciously to override database engine's query plan choices and improve performance 📈 #SQLPerformance"
"🗄️ DB Tip of the Day: Leverage prepared statements and parameterized queries to improve query performance, reduce SQL injection risks, and optimize application code 🚀 #SQLPerformance"

Why does this SQL ORDER BY in subquery get ignored?

Why does this SQL ORDER BY in subquery get ignored. The SQL code uses ORDER BY inside a derived table. In MySQL without LIMIT the optimizer ignores it. In SQL the order you expect is not the order you get.

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

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

Why does this SQL ORDER BY in subquery get ignored? #sqldebugging

YouTube

Why does this SQL phantom read show rows that vanish?

Why does this SQL phantom read show rows that vanish. The SQL code runs REPEATABLE READ. In MySQL another transaction can insert matching rows. In SQL you see rows in one read that disappear in the next.

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

https://www.youtube.com/watch?v=2HZvRkzESXA

Why does this SQL phantom read show rows that vanish? #sqlproductionbug

YouTube

Why does this SQL ORDER BY RAND() melt the database?

Why does this SQL ORDER BY RAND() melt the database. The SQL code uses ORDER BY RAND() for random rows. In MySQL that sorts the entire table. In SQL one query can take down the server.

#whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqlorderbyrand #sqlrandom #sqlsort ...

https://www.youtube.com/watch?v=2G3tRvhnyJM

Why does this SQL ORDER BY RAND melt the database? #sqlperformance

YouTube

Why does this SQL SUM return NULL for empty?

Why does this SQL SUM return NULL for empty result. The SQL code sums a column without COALESCE. In SQL SUM of zero rows returns NULL not zero. In SQL APIs this breaks calculations and causes NaN downstream.

#whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqlsum #sqlnull #sql...

https://www.youtube.com/watch?v=gG4KtBljZ-o

Why does this SQL SUM return NULL for empty? #sqlreliability

YouTube

Boost your PostgreSQL skills with Andrew Atkinson at PG DATA 2026! Join his trainings on SQL Performance Basics, ActiveRecord ORM & Schema Evolution, Scaling with Multiple Databases for practical, hands-on learning to optimize and scale your systems.

🎓 Trainings are included with your PG DATA 2026 ticket — at no extra cost!
Reserve your spot: https://forms.gle/bijKRFF8bc4nRP98A

#PGData #PGData2026 #PostgreSQL 🐘 #SQLPerformance #ORM #DatabaseScaling #DBATraining #TechLearning #OpenSource #HandsOnTraining