Why does this SQL JSON extract never use the index?

Why does this SQL JSON extract never use the index. The SQL code queries JSON with JSON_EXTRACT. In MySQL that cannot use a regular index. In SQL use a generated column with an index.

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

https://www.youtube.com/watch?v=7ybwR_o8Wh8

Why does this SQL JSON extract never use the index? #sqlperformance

YouTube

Why does this SQL gap lock block an insert you never touched?

Why does this SQL gap lock block an insert you never touched. The SQL code uses SELECT FOR UPDATE. In MySQL InnoDB locks the gap. In SQL another session cannot insert in that range.

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

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

Why does this SQL gap lock block an insert you never touched? #sqlrange

YouTube

Why does this SQL UNIQUE constraint allow multiple NULLs?

Why does this SQL UNIQUE constraint allow multiple NULLs. The SQL code adds UNIQUE on a nullable column. In SQL NULL is not equal to NULL so unique allows many NULLs. In SQL this breaks deduplication logic.

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

https://www.youtube.com/watch?v=EY-UOebdlEI

Why does this SQL UNIQUE constraint allow multiple NULLs? #sqlnull

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

Why does this SQL CHAR comparison match wrong with trailing spaces?

Why does this SQL CHAR comparison match wrong with trailing spaces. The SQL code uses CHAR which pads with spaces. In MySQL 'a' and 'a ' compare equal. In SQL lookups you can match the wrong row.

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

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

Why does this SQL CHAR comparison match wrong with trailing spaces? #sqlreliability

YouTube

Why does this SQL UPDATE lock the entire table?

Why does this SQL UPDATE lock the entire table. The SQL code updates with a condition that has no index. In MySQL it locks every row it scans. In SQL services one update blocks all other writes.

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

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

Why does this SQL UPDATE lock the entire table? #sqlanalytics

YouTube

What's wrong with this SQL DATE function blocking the index?

What's wrong with this SQL DATE function blocking the index. The SQL code wraps a datetime column in DATE(). In MySQL functions on columns prevent index use. In SQL this turns indexed lookups into full scans.

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

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

Whats wrong with this SQL DATE function blocking the index? #sqlanalytics

YouTube

Why does this SQL counter lose updates?

Why does this SQL counter lose updates under concurrency. The SQL code reads then writes without locking, so concurrent increments overwrite each other. In SQL services this undercounts events.

#whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqlracecondition #sqlcounterbug #sqlcon...

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

Why does this SQL counter lose updates? #sqldebugging

YouTube

Why does this SQL stored procedure break when you add a column?

Why does this SQL stored procedure break when you add a column. The SQL code uses SELECT * in a procedure. In SQL the result shape changes on schema change. In SQL procedures that call it crash.

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

https://www.youtube.com/watch?v=0tiKd1P5qXQ

Why does this SQL stored procedure break when you add a column? #sqlreliability

YouTube

Why does this SQL partition skip data?

Why does this SQL partition skip data in reporting. The SQL query filters on a partition boundary with the wrong timezone, so rows land in the wrong partition. In SQL analytics this miscounts totals.

#whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqlpartition #sqltimezonebug #sqlr...

https://www.youtube.com/watch?v=8Yw6CZspyrM

Why does this SQL partition skip data? #sqlproductionbug

YouTube