The Heap™ – Consultancy ©®

General on- and off-site discussion for dba.stackexchange.com....
Dec 2, 2023 01:14
Anyway, I'll shut up now. Just wanted to say hi to people, some of whom might or might not remember me (fondly or not!).
Dec 2, 2023 01:14
Heck, just learning nested loops, hash matches, and merge joins helps in leet-code exercises and once in a while even comes in to day-to-day real enterprise software development! It was a hugely valuable experience to get into the data that deep for so long. There are many other ways the database experience has benefited me in any language or task.
Dec 2, 2023 01:13
Though the last version of SQL Server I worked with much was 2012, so I'm probably so very far behind on some things.
Dec 2, 2023 01:12
I do notice that I can still wrangle SQL pretty well when I get the rare chance to. I was a database developer for 7 years. Every now and then that hidden talent gets a chance to show up and it's fun to watch people who do SQL for a living realize that I just might know it better than they do...
Dec 2, 2023 01:10
It's fun to go back to some old questions of mine when they get upvotes anew, and see how they've fared on the site. And unsurprisingly, look at the excellence of @PaulWhite's answer, so long ago! Wizard that he is.
Dec 2, 2023 01:09
Hello everyone! It's been 10 years now since I worked extensively with SQL, but you know, the things I learned during that time still inform and shape my software development career. Learning to think about operations in a set-based way was hugely helpful in wielding C# Linq-to-objects when I was doing that (also many years ago).
5
Nov 22, 2022 20:58
@SeanGallardy If I eat the wrong things, I start to feel unwell, have progressively worse digestive problems, and then start going "down for the count": periods of great weakness and malaise (like nausea, but not in my belly somehow), even going unconscious (where if you force me to stay awake, I'll talk nonsense). It's been a rough ride.
Nov 22, 2022 20:17
@SeanGallardy Congratulations! I'm just entering in to the problem in one sense (though I've been eating mostly low-carb for years). Leaky gut is a beast to fix, it seems.
Nov 22, 2022 20:02
@SeanGallardy I can barely eat anything other than steak right now, or I become unable to work. It sucks.
Nov 17, 2022 03:54
@HannahVernon Or another way to say it is, there are manifold ways to excoriate a grimalkin...
Nov 17, 2022 03:52
@Charlieface It is my awareness of this exact issue (SQL Server SCOPE_IDENTITY() vs. @@IDENTITY) that made me peer closer at the MySQL code running LAST_INSERT_ID() in a separate statement.
Nov 14, 2022 21:52
@Charlieface All it would take would be for the Node.js event loop to just barely skip the .then() inside the first insert() statement in its event loop and hit the .then() inside the second insert statement. Their follow-on Promise chains can execute out of order.
Nov 14, 2022 21:50
@Charlieface But thinking about it, unless a new connection is created for each use of the DB-helper class, then just one place in the code doing this could break things: const db = new MySql(); await Promise.all([db.insert(...), db.insert(...)]) if those inserts are to the same table.
Nov 14, 2022 21:46
@Charlieface Okay, that's helpful. I'll have to dig into the code to see how the connection object is managed. That would be an easy and reliable fix, then. What I might do is some major load testing with a test instance and a test table. Run 1000s of transactions a second through and see if I can get an error.
Nov 14, 2022 21:44
@Charlieface Ha, you WERE answering my question. I guess that makes me a moron for now :)
Nov 14, 2022 21:43
@Charlieface There definitely is connection pooling, and given the way the problematic code is written, the different inserts & ID-fetches are almost certainly using the exact same connection object.
Nov 14, 2022 21:42
@Charlieface I mean, some relational database that runs in AWS. That's what I was thinking about... some alternative to RDS:MySQL
Nov 14, 2022 06:32
Oh man, the original developer on the project emailed me back saying he knew about the data inconsistency possibility in the codebase (with the MySQL INSERT / LAST_INSERT_ID() happening out of order). That's incomprehensible to me. I'm too invested in things, I guess, because I would treat that as priority #1 for fixing, and not just let it go without telling anyone about this urgently needed fix!
Nov 14, 2022 00:00
Thanks for looking into that... I've been busy with so much stuff today. Interesting:
> The mysqldump client utility performs logical backups, producing a set of SQL statements that can be executed to reproduce the original database object definitions and table data. It dumps one or more MySQL databases for backup or transfer to another SQL server. The mysqldump command can also generate output in CSV, other delimited text, or XML format.
Nov 13, 2022 20:56
Oh, and I found a MAJOR wtf in this codebase I've been brought in to help with after the original developer wants out: an INSERT statement followed by (different batch) SELECT * FROM ${table} WHERE id = LAST_INSERT_ID(), run from Node.js in separate Promises, so if two clients do an INSERT at the same time, the first one's LAST_INSERT_ID() could run after the second INSERT... sigh.
Nov 13, 2022 20:53
There is Aurora... hmmm
Nov 13, 2022 20:53
I guess if I'm looking to use a local copy, something like MySQL is the only game in town, probably?
Nov 13, 2022 20:52
Can anyone recommend a relation database in AWS that offers a better backup/restore experience than RDS running MySQL? I wanted to pull down a copy of an RDS/MySQL database for local development, but the only option I found in AWS was to "export snapshot to S3"... of course, this wasn't a backup file, but writing every object out to its own file in some filesystem-version of the database. Not what I was looking for.
Nov 13, 2022 20:50
@ypercubeᵀᴹ I figured I'd have to do a subquery to make the column NULL values turn into something first, then do the grouping query so NULLs could be distinguished.
Nov 13, 2022 06:34
Ahhh there we go. Was being thrown off by not having selected a default database in MySQL Workbench. FUNCTION schema.GROUPING does not exist. Seems like that's it. But I can fake it for now.
Nov 13, 2022 06:30
Does MySQL 5.7 not support the GROUPING() function (to be used with WITH ROLLUP)? I've not used MySQL all that much and am kind of hacking my way through it a bit...
Dec 13, 2019 20:15
@AndriyM Thanks for the trick about NOEXEC. If it lasts past batches it's a pretty simple way to do it.
Dec 12, 2019 18:32
At first I was thinking SET XACT_ABORT ON was good, but then wondered about instead just tracking whether an error occurred, then at the end I can rollback the whole transaction? Only... tracking an error seems kind of hard. I could start two transactions, then rollback one on error, but keep the second, and use tran count to track which state we're in? That seems hacky. Any thoughts?
Dec 12, 2019 18:30
Folks, could you recommend your favorite way in a change script consisting of multiple batches to avoid running subsequent batches after a failed batch? I found dba.stackexchange.com/questions/194515/… but wondered if it got enough attention or might be missing some cool tips.
Apr 12, 2019 00:11
Of course... it should be a database answer. No non-database answers.
 
Sep 20, 2022 13:35
@DanielHatton I should have said Romance languages!
Sep 20, 2022 13:35
@Dilworth It's possible he meant "sensitive"? I've heard some non-native English speakers mix that word up with "sensible" especially because of false cognates in other Germanic languages.
 
Jan 30, 2021 13:01
@Doug It's incorrect to talk about the "number of nines" because infinity minus a number = infinity. Infinity is transcendent. It means "uncountable". If you take infinity and slide it left a little bit, it's still infinity long.
 
Nov 7, 2019 23:02
@RichardSaysReinstateMonica I certainly wasn't there and so can't judge. All I have to go on is your words here.
Nov 7, 2019 22:59
@RichardSaysReinstateMonica It's great what you did for your person who was behind on his reports. Yet, could there have been a way to engage him that didn't lead to him screaming at you first? It's just a thought.
Nov 7, 2019 22:58
@RichardSaysReinstateMonica As for learned helplessness, I know more about that than many.
Nov 7, 2019 22:58
@RichardSaysReinstateMonica If you will consent to look at your answer again, there's nothing in there about anyone helping the guy. There's no indication that you have launched into teaching mode, about the future and that's how he should take your response. A lot of people have a problem with your answer, currently at +11 and -12! Your post simply seems to be berating him in the present for his past actions, a laundry list of ways he failed.
Nov 7, 2019 22:57
@RichardSaysReinstateMonica I suspect that what's going on in the conversational dynamic here is that each of us has had some hard knocks and our current styles reflect our long-term reactions to, and processing of, those things.
Nov 7, 2019 22:55
@RichardSaysReinstateMonica Your more recent words are heartening. They are at odds with the communication and attitude displayed in your other message. It sounds like you have a big heart, that just doesn't come through very clearly sometimes.
Nov 7, 2019 21:26
@RichardSaysReinstateMonica Take responsibility for becoming a better human being!
Nov 7, 2019 21:26
@RichardSaysReinstateMonica There's your disparaging attitude that limits your potential to be an awesome manager. You can't deal with people and their feelings. Get a clue, dude, and take it to the next level. TAKE RESPONSIBILITY for being a better manager who works with people better. Your performance here demonstrates your difficult in caring for people well. It's all well and good to develop your people professionally, but if you're a jerk about it, you're limiting your own potential.
Nov 7, 2019 20:45
In all your comments you haven't once seemed to distinguish between "how much blame attaches to the OP for his past actions" vs. "what can we expect the OP to do in the future now that he has had this learning experience?" The **PROBLEM** in this is that you seem the type to blame inexperienced people who made a simple mistake with the full weight of blame you'd expect on yourself who is ostensibly very experienced.

Basically, you're completely overlooking the human angle, as far as we can tell from your comments. And that's a big, big problem in a manager.
Nov 6, 2019 18:55
@RichardSaysReinstateMonica you’re acting ridiculous. My statement wasn’t a global one. Your attack of slanted interpretation is inappropriate and unnecessary. I reject YOU as my teacher on THIS topic. Your quickness to characterize and interpret and globalize all doubly confirm that working under you would definitely be a series of amazing lessons... but not the ones you think! :) :)
Nov 6, 2019 18:55
@RichardSaysReinstateMonica your assumption I need to be taught something isn’t accurate. It is unlikely I’d make the same mistake as the OP. The issue here is how to handle that mistake. Lightly.
Nov 6, 2019 18:55
@Eigentime I’m pretty sure the customer did know the difference between TO and CC given he addressed only the superior directly in the greeting.
Nov 6, 2019 18:55
@RichardU the core fact is that the OP didn’t realize it was his responsibility, and had a few signals that are a reasonable explanation for that belief. You’re taking such an extreme view of this! I understand the principle, but was no risk of death in this scenario, lol. Glad you’re not my boss, because you’re acting mighty pointy-haired. The business should just clarify what is expected of both employees because the failure of the boss to respond to an email addressed to him about a project he worked on and the other guy didn’t was a key contributing factor to the gap in customer support.
Nov 6, 2019 18:55
@RichardU i reread the OP and what’s clear to me is that it was very much not clear that he was supposed to do anything. He knew nothing about the project, the person who did know was in the TO slot, and the email was addressed directly to that person. It should not be a fireable offense or even a real disciplinary one that he just didn’t realize there was something for him to do. If he was supposed to provide support on this project, why was he never told?
Nov 6, 2019 18:55
This response makes no distinction between TO and CC. If CC has the exact same responsibilities as TO, then what use is it? Your answer renders CC useless.
 
Sep 30, 2019 01:48
But what about the moment the crowd turns vicious and you truly fear for your life, and there's no way out but to drive forward?
 
Sep 27, 2019 17:11
"bet your bottom"? Not something I normally bet against...