@PrecisionSQL

6 Followers
2 Following
200 Posts
Daily SQL boosts to help you write better queries with zero confusion

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

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

Whats wrong with this SQL REPLACE deleting related rows? #sqldebugging

YouTube

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

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

Whats wrong with this SQL dividing integers? #sqltruncate

YouTube

How to Use Temporary Tables to Replace Slow Subqueries

Materialize once. Query fast.

#mysql #temptable #subquery #performance #howto #query

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

How to Use Temporary Tables to Replace Slow Subqueries #subquery

YouTube

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

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

Whats wrong with this SQL connection using wrong charset? #sqlreliability

YouTube

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

https://www.youtube.com/watch?v=a-oSg485bdE

Whats wrong with this SQL INSERT ON DUPLICATE overwriting everything? #sqlonduplicate

YouTube

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

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

Whats wrong with this SQL DISTINCT hiding duplicate inserts? #sqlmask

YouTube

Why does this SQL cache stampede?

Why does this SQL cache stampede under load. The SQL layer recomputes values on expiry without a lock, so every request hits the database. In SQL services this melts the backend.

#whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqlcachestampede #sqlcacherefresh #sqldatabaseload #sqlperfo...

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

Why does this SQL cache stampede? #sqlcachestampede

YouTube

How to Stop DISTINCT From Hiding Data Problems

DISTINCT can mask duplicate writes.

#mysql #distinct #duplicates #howto #bug #analytics

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

How to Stop DISTINCT From Hiding Data Problems #analytics

YouTube

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

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

Why does this SQL retry backoff melt servers? #sqlresilience

YouTube

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

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

Why does this SQL MERGE overwrite when it should not? #sqloverwrite

YouTube