Feed aggregator
'Sony is Still Stubborn About the Size of Its Cameras'
Read more of this story at Slashdot.
Judge Allows Nationwide Class Action Against Anthropic Over Alleged Piracy of 7 Million Books For AI Training
Read more of this story at Slashdot.
Cancer Death Rates Fall One-Third in US Since 1990s as Prevention Efforts Take Hold
Read more of this story at Slashdot.
Uber Plans 20,000 Robotaxis in Six-Year Rollout with Lucid and Nuro
Read more of this story at Slashdot.
Cinemas Weigh Launching New Large Screen Brand To Challenge Imax
Read more of this story at Slashdot.
VMware Reboots Its Partner Program Again With New Invite-Only Program
Read more of this story at Slashdot.
360 Million Indians Just Got Premium AI Chatbots For Free For a Year
Read more of this story at Slashdot.
Transatlantic Communications Cable Doubles As Ocean Sensor
Read more of this story at Slashdot.
CodeSOD: Just a Few Updates
Misha has a co-worker who has unusual ideas about how database performance works. This co-worker, Ted, has a vague understanding that a SQL query optimizer will attempt to find the best execution path for a given query. Unfortunately, Ted has just enough knowledge to be dangerous; he believes that the job of a developer is to write SQL queries that will "trick" the optimizer into doing an even better job, somehow.
This means that Ted loves subqueries.
For example, let's say you had a table called tbl_updater, which is used to store pending changes for a batch operation that will later get applied. Each change in updater has a unique change key that identifies it. For reasons best not looked into too deeply, at some point in the lifecycle of a record in this table, the application needs to null out several key fields based on the change value.
If you or I were writing this, we might do something like this:
update tbl_updater set id = null, date = null, location = null, type = null, type_id = null where change = @changeAnd this is how you know that you and I are fools, because we didn't use a single subquery.
update tbl_updater set id = null where updater in (select updater from tbl_updater where change = @change) update tbl_updater set date = null where updater in (select updater from tbl_updater where change = @change) update tbl_updater set location = null where updater in (select updater from tbl_updater where change = @change) update tbl_updater set type = null where updater in (select updater from tbl_updater where change = @change) update tbl_updater set date = null where updater in (select updater from tbl_updater where change = @change) update tbl_updater set type_id = null where updater in (select updater from tbl_updater where change = @change)So here, Ted uses where updater in (subquery) which is certainly annoying and awkward, given that we know that change is a unique key. Maybe Ted didn't know that? Of course, one of the great powers of relational databases is that they offer data dictionaries so you can review the structure of tables before writing queries, so it's very easy to find out that the key is unique.
But that simple ignorance doesn't explain why Ted broke it out into multiple updates. If insanity is doing the same thing again and again expecting different results, what does it mean when you actually do get different results but also could have just done all this once?
Misha asked Ted why he took this approach. "It's faster," he replied. When Misha showed benchmarks that proved it emphatically wasn't faster, he just shook his head. "It's still faster this way."
Faster than what? Misha wondered.
[Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.Stellantis Abandons Hydrogen Fuel Cell Development
Read more of this story at Slashdot.
Germany Is Building the World's Tallest Wind Turbine
Read more of this story at Slashdot.
Intel Layoffs Exceed 5,000 Across US
Read more of this story at Slashdot.
Scale AI Lays Off 200 Employees: 'We Ramped Up Our GenAI Capacity Too Quickly'
Read more of this story at Slashdot.
Linux Reaches 5% On Desktop
Read more of this story at Slashdot.
Chinese Authorities Are Using a New Tool To Hack Seized Phones and Extract Data
Read more of this story at Slashdot.
Steam Now Bans Games That Violate the 'Rules and Standards' of Payment Processors
Read more of this story at Slashdot.
OpenAI Says It Will Use Google's Cloud For ChatGPT
Read more of this story at Slashdot.
A Retro Gaming YouTuber Faces Possible Jail Time For Reviewing Gaming Handhelds
Read more of this story at Slashdot.
The Geography of Innovative Firms
Read more of this story at Slashdot.
VMware Reboots Its Partner Program Again
Read more of this story at Slashdot.