home.social

#sqlcodereview — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #sqlcodereview, aggregated by home.social.

  1. 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...

    youtube.com/watch?v=f4mdNHOjKTg

  2. 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...

    youtube.com/watch?v=f4mdNHOjKTg

  3. 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...

    youtube.com/watch?v=f4mdNHOjKTg

  4. 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 ...

    youtube.com/watch?v=2HZvRkzESXA

  5. 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 ...

    youtube.com/watch?v=2HZvRkzESXA

  6. 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 ...

    youtube.com/watch?v=2HZvRkzESXA

  7. 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 ...

    youtube.com/watch?v=2G3tRvhnyJM

  8. 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 ...

    youtube.com/watch?v=2G3tRvhnyJM

  9. 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 ...

    youtube.com/watch?v=2G3tRvhnyJM

  10. 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...

    youtube.com/watch?v=gG4KtBljZ-o

  11. 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...

    youtube.com/watch?v=gG4KtBljZ-o

  12. 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...

    youtube.com/watch?v=gG4KtBljZ-o

  13. What's wrong with this SQL REPLACE deleting related rows?

    What's wrong with this SQL REPLACE deleting related rows. The SQL code uses REPLACE instead of INSERT ON DUPLICATE. In MySQL REPLACE deletes then inserts, firing deletes on child tables. In SQL this cascades to data loss.

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

    youtube.com/watch?v=fIHKcR7Dh28

  14. What's wrong with this SQL REPLACE deleting related rows?

    What's wrong with this SQL REPLACE deleting related rows. The SQL code uses REPLACE instead of INSERT ON DUPLICATE. In MySQL REPLACE deletes then inserts, firing deletes on child tables. In SQL this cascades to data loss.

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

    youtube.com/watch?v=fIHKcR7Dh28

  15. What's wrong with this SQL REPLACE deleting related rows?

    What's wrong with this SQL REPLACE deleting related rows. The SQL code uses REPLACE instead of INSERT ON DUPLICATE. In MySQL REPLACE deletes then inserts, firing deletes on child tables. In SQL this cascades to data loss.

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

    youtube.com/watch?v=fIHKcR7Dh28

  16. What's wrong with this SQL dividing integers?

    What's wrong with this SQL dividing integers losing decimals. The SQL code divides two integer columns. In SQL integer division truncates to integer. In SQL analytics this undercounts rates and percentages.

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

    youtube.com/watch?v=xULrs5LG75M

  17. What's wrong with this SQL dividing integers?

    What's wrong with this SQL dividing integers losing decimals. The SQL code divides two integer columns. In SQL integer division truncates to integer. In SQL analytics this undercounts rates and percentages.

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

    youtube.com/watch?v=xULrs5LG75M

  18. What's wrong with this SQL dividing integers?

    What's wrong with this SQL dividing integers losing decimals. The SQL code divides two integer columns. In SQL integer division truncates to integer. In SQL analytics this undercounts rates and percentages.

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

    youtube.com/watch?v=xULrs5LG75M

  19. What's wrong with this SQL connection using wrong charset?

    What's wrong with this SQL connection using wrong charset. The SQL code connects without specifying charset. In MySQL wrong default corrupts Unicode. In SQL you get mojibake in the database.

    #whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqlcharset #sqlutf8 #sq...

    youtube.com/watch?v=io54Ac5fdeQ

  20. What's wrong with this SQL connection using wrong charset?

    What's wrong with this SQL connection using wrong charset. The SQL code connects without specifying charset. In MySQL wrong default corrupts Unicode. In SQL you get mojibake in the database.

    #whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqlcharset #sqlutf8 #sq...

    youtube.com/watch?v=io54Ac5fdeQ

  21. What's wrong with this SQL connection using wrong charset?

    What's wrong with this SQL connection using wrong charset. The SQL code connects without specifying charset. In MySQL wrong default corrupts Unicode. In SQL you get mojibake in the database.

    #whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqlcharset #sqlutf8 #sq...

    youtube.com/watch?v=io54Ac5fdeQ

  22. What's wrong with this SQL INSERT ON DUPLICATE overwriting everything?

    What's wrong with this SQL INSERT ON DUPLICATE overwriting everything. The SQL code uses ON DUPLICATE KEY UPDATE with VALUES(). In SQL on duplicate it overwrites even columns you did not mean to change. In SQL upserts this corrupts data.

    #whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics...

    youtube.com/watch?v=a-oSg485bdE

  23. What's wrong with this SQL INSERT ON DUPLICATE overwriting everything?

    What's wrong with this SQL INSERT ON DUPLICATE overwriting everything. The SQL code uses ON DUPLICATE KEY UPDATE with VALUES(). In SQL on duplicate it overwrites even columns you did not mean to change. In SQL upserts this corrupts data.

    #whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics...

    youtube.com/watch?v=a-oSg485bdE

  24. What's wrong with this SQL INSERT ON DUPLICATE overwriting everything?

    What's wrong with this SQL INSERT ON DUPLICATE overwriting everything. The SQL code uses ON DUPLICATE KEY UPDATE with VALUES(). In SQL on duplicate it overwrites even columns you did not mean to change. In SQL upserts this corrupts data.

    #whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics...

    youtube.com/watch?v=a-oSg485bdE

  25. What's wrong with this SQL DISTINCT hiding duplicate inserts?

    What's wrong with this SQL DISTINCT hiding duplicate inserts. The SQL code uses DISTINCT to dedupe. In SQL DISTINCT masks the fact that duplicates were written. In SQL the root cause stays and grows.

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

    youtube.com/watch?v=hhCIBFoiC6M

  26. What's wrong with this SQL DISTINCT hiding duplicate inserts?

    What's wrong with this SQL DISTINCT hiding duplicate inserts. The SQL code uses DISTINCT to dedupe. In SQL DISTINCT masks the fact that duplicates were written. In SQL the root cause stays and grows.

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

    youtube.com/watch?v=hhCIBFoiC6M

  27. What's wrong with this SQL DISTINCT hiding duplicate inserts?

    What's wrong with this SQL DISTINCT hiding duplicate inserts. The SQL code uses DISTINCT to dedupe. In SQL DISTINCT masks the fact that duplicates were written. In SQL the root cause stays and grows.

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

    youtube.com/watch?v=hhCIBFoiC6M

  28. Why does this SQL retry backoff melt servers?

    Why does this SQL retry backoff melt servers during outages. The SQL job retries on a fixed schedule without jitter, so all workers stampede at once. In SQL pipelines this keeps the outage alive.

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

    youtube.com/watch?v=ZWGlA3LIntI

  29. Why does this SQL retry backoff melt servers?

    Why does this SQL retry backoff melt servers during outages. The SQL job retries on a fixed schedule without jitter, so all workers stampede at once. In SQL pipelines this keeps the outage alive.

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

    youtube.com/watch?v=ZWGlA3LIntI

  30. Why does this SQL retry backoff melt servers?

    Why does this SQL retry backoff melt servers during outages. The SQL job retries on a fixed schedule without jitter, so all workers stampede at once. In SQL pipelines this keeps the outage alive.

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

    youtube.com/watch?v=ZWGlA3LIntI

  31. Why does this SQL MERGE overwrite when it should not?

    Why does this SQL MERGE overwrite when it should not. The SQL code uses MERGE with a WHEN MATCHED that always runs. In SQL the logic can overwrite rows you intended to skip. In SQL sync jobs this corrupts data.

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

    youtube.com/watch?v=FzZuQz1s4oE

  32. Why does this SQL MERGE overwrite when it should not?

    Why does this SQL MERGE overwrite when it should not. The SQL code uses MERGE with a WHEN MATCHED that always runs. In SQL the logic can overwrite rows you intended to skip. In SQL sync jobs this corrupts data.

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

    youtube.com/watch?v=FzZuQz1s4oE

  33. Why does this SQL MERGE overwrite when it should not?

    Why does this SQL MERGE overwrite when it should not. The SQL code uses MERGE with a WHEN MATCHED that always runs. In SQL the logic can overwrite rows you intended to skip. In SQL sync jobs this corrupts data.

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

    youtube.com/watch?v=FzZuQz1s4oE

  34. What's wrong with this SQL query doubling the boundary row?

    What's wrong with this SQL query doubling the boundary row in a report. The SQL code uses BETWEEN for a date range. In SQL BETWEEN is inclusive on both ends so the boundary gets counted twice if used in a join.

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

    youtube.com/watch?v=DuZMlxodwwo

  35. What's wrong with this SQL query doubling the boundary row?

    What's wrong with this SQL query doubling the boundary row in a report. The SQL code uses BETWEEN for a date range. In SQL BETWEEN is inclusive on both ends so the boundary gets counted twice if used in a join.

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

    youtube.com/watch?v=DuZMlxodwwo

  36. What's wrong with this SQL query doubling the boundary row?

    What's wrong with this SQL query doubling the boundary row in a report. The SQL code uses BETWEEN for a date range. In SQL BETWEEN is inclusive on both ends so the boundary gets counted twice if used in a join.

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

    youtube.com/watch?v=DuZMlxodwwo

  37. What's wrong with this SQL COALESCE preventing index use?

    What's wrong with this SQL COALESCE preventing index use. The SQL code filters with COALESCE(column, default). In MySQL functions on columns block indexes. In SQL the query scans the whole table.

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

    youtube.com/watch?v=OrPyGHSBlqQ

  38. What's wrong with this SQL COALESCE preventing index use?

    What's wrong with this SQL COALESCE preventing index use. The SQL code filters with COALESCE(column, default). In MySQL functions on columns block indexes. In SQL the query scans the whole table.

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

    youtube.com/watch?v=OrPyGHSBlqQ

  39. What's wrong with this SQL COALESCE preventing index use?

    What's wrong with this SQL COALESCE preventing index use. The SQL code filters with COALESCE(column, default). In MySQL functions on columns block indexes. In SQL the query scans the whole table.

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

    youtube.com/watch?v=OrPyGHSBlqQ

  40. Why does this SQL batch INSERT hold locks for minutes?

    Why does this SQL batch INSERT hold locks for minutes. The SQL code inserts millions of rows in one statement. In MySQL that holds locks until done. In SQL a huge insert blocks all other writes.

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

    youtube.com/watch?v=jsfy-AaKG20

  41. Why does this SQL batch INSERT hold locks for minutes?

    Why does this SQL batch INSERT hold locks for minutes. The SQL code inserts millions of rows in one statement. In MySQL that holds locks until done. In SQL a huge insert blocks all other writes.

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

    youtube.com/watch?v=jsfy-AaKG20

  42. Why does this SQL batch INSERT hold locks for minutes?

    Why does this SQL batch INSERT hold locks for minutes. The SQL code inserts millions of rows in one statement. In MySQL that holds locks until done. In SQL a huge insert blocks all other writes.

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

    youtube.com/watch?v=jsfy-AaKG20

  43. Why does this SQL prepared statement reuse the wrong plan?

    Why does this SQL prepared statement reuse the wrong plan. The SQL code uses a prepared statement with different param values. In MySQL the first execution picks a plan. In SQL later values may need a different plan but get the wrong one.

    #whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldatain...

    youtube.com/watch?v=PJT_qVSjNBc

  44. Why does this SQL prepared statement reuse the wrong plan?

    Why does this SQL prepared statement reuse the wrong plan. The SQL code uses a prepared statement with different param values. In MySQL the first execution picks a plan. In SQL later values may need a different plan but get the wrong one.

    #whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldatain...

    youtube.com/watch?v=PJT_qVSjNBc