#sqlengineering — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #sqlengineering, aggregated by home.social.
-
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...
-
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...
-
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...
-
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 ...
-
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 ...
-
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 ...
-
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 ...
-
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 ...
-
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 ...
-
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...
-
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...
-
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...
-
Why does this SQL OFFSET get slower with every page?
Why does this SQL OFFSET get slower with every page. The SQL code uses OFFSET for pagination. In MySQL OFFSET forces a full scan and skip. In SQL page 10000 can take minutes.
#whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqloffset #sqlpagination #sqlkeyset #sqlscaling
-
Why does this SQL OFFSET get slower with every page?
Why does this SQL OFFSET get slower with every page. The SQL code uses OFFSET for pagination. In MySQL OFFSET forces a full scan and skip. In SQL page 10000 can take minutes.
#whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqloffset #sqlpagination #sqlkeyset #sqlscaling
-
Why does this SQL OFFSET get slower with every page?
Why does this SQL OFFSET get slower with every page. The SQL code uses OFFSET for pagination. In MySQL OFFSET forces a full scan and skip. In SQL page 10000 can take minutes.
#whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqloffset #sqlpagination #sqlkeyset #sqlscaling
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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 #...
-
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 #...
-
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 #...
-
Why does this SQL aggregate undercount?
Why does this SQL aggregate undercount in production. The SQL code groups by a rounded timestamp, collapsing multiple events into one bucket. In SQL analytics this undercounts traffic.
#whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqlaggregatebug #sqlgroupby #sqlreporting #sqlda...
-
Why does this SQL aggregate undercount?
Why does this SQL aggregate undercount in production. The SQL code groups by a rounded timestamp, collapsing multiple events into one bucket. In SQL analytics this undercounts traffic.
#whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqlaggregatebug #sqlgroupby #sqlreporting #sqlda...
-
Why does this SQL aggregate undercount?
Why does this SQL aggregate undercount in production. The SQL code groups by a rounded timestamp, collapsing multiple events into one bucket. In SQL analytics this undercounts traffic.
#whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqlaggregatebug #sqlgroupby #sqlreporting #sqlda...
-
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...
-
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...