There are no bad queries…right?

I’ve worked with developers who write terrible, extremely questionable, queries. I’ve said many times over the course of my career, “That’s a bad query.” You know the saying about there not being any bad dogs, right? Only bad owners? What if that’s true for queries? What if there are no bad queries, just bad environments for queries, or bad data sets for a certain query, or a bad plan for a good query? Maybe it’s about the data/query/environment interaction more than the query itself?

As with everything SQL, I started thinking about that in the context of psychology…

Psychology tells us the individual both evokes and provokes the environment (including others in the environment) in which it finds itself (person-environment interaction). However, there is an even cooler concept (that freaks me out a bit), that we self-select environments that we are in. Meaning…we choose the shit storm we blame for our unhappiness.

Pardon me for a minute.


The asshole coworker? Not your fault, right?

Well, not so fast.

Let’s weave these together.

What if you have a query that runs great on a table with 10 rows? And then you move it to prod where there are 2.8 billion rows? What if it is on a laptop with 1gb of RAM allocated to SQL? What if it’s also running 85 other things just then?Bad query, or bad environment? Both is an option, too, of course. (If you said “bad dev environment,” you get a gold star!) What if you add indexes? What if you update statistics? What if you switch to columnstore? What if you put it on a grown-up server? What if you add a ton of RAM? What if you cache the table? What if you make the table in-memory? These could all be said to be environmental design to improve execution of the query because you’ve changed nothing with the query itself.

This is what happens to DBAs a lot. Queries come to us and are not able to be edited (third party software, grumpy developers, whatever). We then set about tying ourselves into knots to create an environment where that “bad query” can thrive.

People are like this, too, I feel. Sure, there are “bad” humans. Serial killers, for one come to mind. Narcissists are another. However, the vast majority of people mean to do their best. We try hard, maybe not for all the right reasons, but very rarely do most people set out to do harm to others. Some environments, some people in those environments, generate such a reaction in the individual that the literal worst comes out of them. Sometimes this means people need to remove themselves from harmful environments (or better yet, the toxic people should be removed), but other times (just like query tuning) environmental design can make a huge difference.

How can we go about improving a poor interaction? It’s the same process as for query tuning, actually. Observe. Detect patterns. Here you have two options (just like with SQL Queries):

Work backwards to find root cause, address root cause.


Take a stab at what you think might help (up the RAM!), observe again, record the results. Then tweak and try again. Sometimes you make the interaction worse, sometimes better. All results inform our future choices.

I’ve recently had the opportunity to observe a couple of significant workplace behavioral issues. Where I used to get extremely upset, I’m now able to observe and say, ok, what’s the pattern here? Sometimes what I come back to is yet another concept in Psychology that we are most disgusted by traits in others that we have and hate about ourselves. Having spent a long time in therapy, and worked through a lot of cognitive distortions, when I see them in others it’s like a huge sign flashing over their heads. The interesting thing is, I will feel dislike way before it clicks why.

So, let’s bring it back to what I said earlier…we self-select our environments. If I accept a job only to find out later I clash with someone, the question I ask myself is…Why did I choose that job over others without team members with this characteristic? Then I ask, “What in me has that trait that I’m not in touch with?” Finding yourself in a person-environment interaction that triggers all your vulnerable spots should be an invitation to understand those places on a deeper level.

Sometimes fixing a bad query (or person-environment interaction) is about environmental design. You leave the bad job, you beef up your server, you defrag your indexes…whatever it takes. Sometimes it’s about rewriting the query, though. You look at how you can get more efficiency out of the TSQL and reduce I/O. Sometimes you look at your own issues and how they evoke and provoke others.

Sometimes, it’s all of the above.

When you can rewrite the query, update statistics, and add more RAM, you do.

When you are able to extract yourself from unhealthy environments AND leverage those experiences to understand why you self-selected such a situation, why you stayed in such a situation for any length of time, and what you can do in the future to handle it differently…you do. You rewrite your own damn query.

Where’d Donna go? Who is Ellis?

When I was a little girl, I desperately wanted a nickname.  Unfortunately, there’s not much you can do with “Donna.”  My dad called me DJ, but no one else did, and the fact that both my brothers had names which easily lent themselves to nicknames (as did my parents), was pretty hard for me growing up.  Don’t know why it mattered so much, but it really did. And here we are.


I remember as a young child (maybe 5ish?) asking for a nickname.  My mother said sure, then laughed at my suggestion (“Bubbles”) and said it was a stripper name.  Clearly, a missed opportunity to have been an early Powerpuff Girl, but whatever.  Parents do the best they can with the information they have at the time.  (In all honesty, Buttercup is really the Powerpuff Girl I’d want to be, but Bubbles is probably more accurate: “Bubbles…is seen as kind and very sweet, but she is also capable of extreme rage…”  All the yeps.) 


So, long story short, after the last two years of transformation getting my shit together, and also a lot of great time spent with wonderful people embracing their true selves, I had a moment of thinking, “If I were 18 and had my life to do over again, I’d totally change my name.”

Wait for it…

Keep waiting for it…

<Several weeks later…>

Umm…I’m 46. I’ve lived half my life (if I’m lucky) with a name I don’t love, that I don’t think expresses me, and isn’t nickname-able (is that a word?).  What if I thought about changing it?

See what I did there?

I sneaked up on it.

I didn’t rush right into “What if I changed it?” That’s overwhelming, scary, huge, blah, blah, blah.  I cozied up to it. For several months.  Like four.  Finally, I started casually bringing it up to people, starting with my hubby. Here’s how that went:

 Me: “So, what would you think if I changed my name?”

Hubby: “Your last name? Like go back to your maiden name?”

Me: “No, my first name…” <insert whole story of not liking my name which I’ve never told him despite knowing him for over 30 years>

Him: “Oh yeah, fine, whatever. I was just worried you didn’t want to be married anymore. What name?”

Me: “Oh, uh…I hadn’t gotten that far. No idea.”


Then I brought it up to my adult kids:


Me: “How big of a mid-life crisis would it be to change my first name?”

Adult Daughter: “You do you. What name?”

Me: “Oh…uh…I hadn’t gotten that far.  No idea.”


 Me: “How big of a mid-life crisis would it be to change my first name?”

Other Adult Daughter: “Cool! What name?”

Me: “Oh…uh…I hadn’t gotten that far.  No idea.”

and the one child still at home:

Me:  “How big of a mid-life crisis would it be to change my first name?”

Teenager: “Do whatever makes you happy. What name?”

Me: “Oh…uh…I hadn’t gotten that far.  No idea.”


I kept talking to family and friends, and just sharing my “cozy-ing” up to the idea.  Told them I was considering it, but was taking my time.  That I hadn’t even gotten to the point of picking a name, I was still on the “Could I?” Part of this process.

As a previously divorced woman in the corporate world, I’ve changed my name a couple of times.  I’ve had email addresses which had my maiden name, some with married names, my passport didn’t match my ss card, etc., etc.  But changing my first name?  Who does that?  And also, for a reason like “Because I wanted to!” Seems like a LOT of work for something rather minor.  And believe me, it is a lot of work.  But also, we have professional personas, particularly in tech, and particularly in this era of LinkedIn, and other social media platforms.  While I’ve generally kept my full name off of my blogs, twitter, etc., and my fb is private and under my maiden name, I do that for privacy reasons (see the “previously divorced” bit…), but LinkedIn is obviously me.  When I presented at the SQL Server Users group that was as me.  

I’m about to submit a couple of abstracts for a SQL Saturday.  And (conveniently?) I’m also switching jobs right now.  I literally just mailed the paperwork for the records request (required for the motion to change my name).  So, it actually dawned on me that my name change is about to get very public, very quickly.  I need to be ok with that.  In some ways, it’s kind of a big non-event, and in others, this is completely self-indulgent.  I also need to be ok with that. :)

I’m adding Éloïse to be my first name, moving Donna to join my old middle name, and keeping my last name.  There are a lot of reasons for “adding” a name, and not “changing” my name outright…but this is the line between sharing and TMI. I will say that I picked Éloïse because it has so many amazing nickname possibilities, it is French, (and if you know me, you know I love all things French), and it has a reported meaning of “Healthy” and “Wide.”  Both kinda apply here, too! 😊  One of the first nicknames that jumped out is Ellie, which is super close to the name Ellis (who was a total bad-ass I worked with at MS many years ago), so, for the time being, Ellis is my preferred nickname.

However, as the saying goes, feel free to call me anything but late to dinner!

Narcissism in Tech – Part 1

 I feel like there is no way to do this topic justice unless it’s a series.  So, to that end, I’m just going to cover a short aspect of this each post.  Today’s part: Are Narcissists disproportionately more prevalent in tech?


And to answer that with the standard database admin answer, “It depends…” We are going to have to get some clarity.  First of all, what are we talking about when we say “Narcissist”?  A person can have narcissistic behaviors, narcissistic traits, or a full blown narcissistic personality disorder (same as many other aspects of personality, such as dependent personality, or OCD kinds of behaviors). The prevalence of Narcissistic Personality Disorder (NPD) in the general population is believed to be around 0.2 percent (Larsen and Buss, 2014). 

Since I’m obviously not a Psychologist or Psychiatrist, and diagnosing coworkers who aren’t your professional patients, is never advised, all I can say is that it seems to me that a lot of people in tech either exhibit narcissistic behaviors or traits.  Full stop.  


But it still does seem to me that there is a LOT of narcissism in technology.  Why is that?  Does the industry attract people with those behaviors, traits, or disorders? Does the environment encourage narcissism to succeed?  Is there some kind of “career Darwinism” at play here, where the non-narcissists weed themselves out of the workforce?  Yes. All of the above, more than likely.


If the industry trending white male (who are also more likely to be narcissistic, see notes) created an elitist atmosphere which systemically excluded women and minorities, it makes sense that those who saw themselves as superior and elite would gravitate towards it.  Speculation, of course. On the superior/elite part.  Women and people of color have been shut out of tech for no good reason for decades.  So if narcissists (lumping behaviors, traits, and NPD all together here), are elitist gatekeepers, and enjoy their status as such, they make staying in tech miserable for those around them, but also hire people who reflect themselves, and perpetuate the cycle.


How are they not removed from the workforce?  Well, narcissists are often motivated, charming, and seek positions of power.  Like any spectrum, narcissists can range from annoying to dangerous.  I mostly concern myself with the middle of the road ones, whose behaviors are toxic, maybe traumatic to anyone who has previously suffered narcissistic abuse, or maybe even unethical (and thus dangerous to the business) due to their inability to accept responsibility, admit mistakes, or ask for help.


I’m really generalizing, sure.  Here’s the thing, though. I’ve worked in technology for 25 years.  I’ve worked for major software companies, I’ve worked for local government, and everything in between. I’ve never worked in an IT department without multiple people who had pervasive, observable narcissistic behaviors.  I actually even worried for a long time that *I* might be a narcissist, after I learned about vulnerable narcissism (maybe I am, who knows).  You know the joke that 3 out of 5 people are assholes…think of your 4 closest friends, if more than one of them isn’t an asshole, you’re the asshole.


So, let me just summarize the DSM 5 criteria for NPD:

  • Grandiose sense of self-importance
  • Preoccupation with fantasies of unlimited success, power, brilliance, beauty, or ideal love
  • Belief that one is special anc can only be understood by or associate with special people or institutions
  • A need for excessive admiration
  • A sense of entitlement (to special treatment)
  • Exploitation of others
  • A lack of empathy
  • Envy of others or the belief that one is the object of envy
  • Arrogant, haughty behavior or attitudes


Next let’s talk about what that looks like in the office.





Random web results, because my research journal access ended when I graduated. Bummer.




Larson, R., Buss, D.M. (2014). Personality psychology: Domains of knowledge about human nature, 6th ed. New York, NY:McGraw-Hill Education.



Men are more narcissistic: