Monthly Grinder

Hi there! I’m supposed to add a witty and mildly snarky intro here, but I’m rapidly running out of ideas. Oh well, maybe something self-referential will do for now. The links are why you’re reading this anyway. So let’s roll!
-
Fiery hot take of the month: SQL servers rule, SQL itself sucks.
-
Changing which file a table is stored in should, in principle, be easy. In practice, this has a few unneccessary nuances to it: you can’t move a table, you move its clustered index. And you can’t do this with
CREATE INDEX
(that won’t move LOB data, for some reason), you have to do it with partioning-related magickery. Once you know all that, it is easy… having had to get there first is the annoying part. -
There’s a lot to know about database maintenance, to keep it running in tip-top shape. Luckily you have pre-packaged solutions for this, too.
-
At first glance, a query like
INSERT (blah) WHERE NOT EXISTS (blah)
should never violate a UNIQUE constraint, right? Wrong. Locking is super-minimal by default, so things can go fast. This also means the EXISTS check will release its lock before the INSERT takes one, letting a concurrent change sneak in between the two. Details (and solution) here. -
Finally there’s good use case for CSS container queries: resizeable beards! (To be fair, they are pretty useful for other tasks as well, such as resizeable mustaches. And ultra-flexible responsive layouts, I guess.)
-
I was slightly surprised to learn that arrow functions don’t have access to the
arguments
object, unlike regular function expressions. Which is why it’s a bit of a dick move to have a feature which is a shorter alternative to existing functionality and also subtly different. -
Here’s a cute little Docker footgun with the image prune command: what a ‘dangling’ image means exactly is only defined in the online docs. Turns out it keeps tagged images, even if they’re unreferenced. So if you tag each build you make, and don’t want disk usage to approach infinity, you’ll also want the
--all
flag. -
Finally, the JS dream-within-a-dream becomes reality! First we had browsers running JS. Then came Node to run JS outside of browsers. And now, we got WebContainers to run Node within browsers. And thus the circle is completed! …That said, as cool as this sounds, adding yet more layers of software onto an already giant pile may not be the best for preserving your sanity.
-
“Bash sucks for scripting, use something better, like JavaScript.” This sounded ridiculous at first glance, but with zx, this might unironically be a good idea.
-
Fun link of the month: The case of the 50ms request, an interactive performance murder mystery.
That’s it for this time, see you next month!