Thursday, August 23, 2007

Am I Thinking About The Right Thing?

I have thought for a long time about deliberately ordering my thought processes. It's something that I do quite frequently. I'd like to share that with people and maybe spur others to do it more, but ironically I'm finding it difficult to express the concept clearly.

I think I'll start for now with an example. If I come back to this topic later, I can build on that example and maybe come up with something that helps me communicate what I'm talking about more effectively.

Sometimes I wonder if the way I think is substantially different from the way many people think. I mean, the areas where my brain works well (or doesn't work well) may not coincide with many people's. So I'm not really sure about the validity of some of my thoughts on how one might order one's own thought processes to yield better results. For example, I like to use spatial representations to figure out problems. There are many times when working on a query that I imagine little squares (representing tables or groups or some kind of data) touching each other, splitting, moving, folding, and so on. But for someone who doesn't think well spatially, that's probably not going to work. There are other modes and ways, though. So even if you can't relate directly to what I'm talking about, maybe you can find some comparable process that does work for you, that helps you be more deliberate in your thinking process.

On the other hand, maybe I'm way out in left field. Maybe my brain is stuffed full of cheese-filled rotten rutabagas! So take what I say here with a grain of salt.

When one is doing analysis of a query, one should check each thing along the way to see if it's giving the right value. It's kind of like when you have a problem with a computer peripheral, say, a printer. There is sort of a list, roughly from lowest to highest: Is it turned on? Is the power cable plugged in? Is the network/parallel cable connected to the right location? Does it have paper? Are error codes showing, is there a paper jam, are there any obvious latches or doors that need to be closed, is there a ready mode that it needs to enter? Can you generate a test page? If it's a network printer, can you ping it? Can anyone else print to it? Can you print to it with a different OS? Can you print to it with a different program? Can you print a smaller document? Can you print a document without images in it? Can you print a document with a different font?

If you find yourself troubleshooting at a certain level and it's not working, then back up and go to the more basic questions. You might even start at the beginning. Doing this helps you check your assumptions and guides you into the next correct troubleshooting step. If the extent of the description of the problem is "I can't print," you don't know much at all. But if the problem is, "I can print from Joe's computer but not from mine," then you can be directed to the level of problem-solving you ought to be at. Since now you know that it's plugged in, turned on, ready, has paper, is connectable for Joe and is responding to print requests, what level are you at? You're ready to verify your own connectivity. Only then deal with access rights. Then drivers. Then different programs. Then things affecting printer memory.

Don't waste your time with printing from different programs until you're sure you can even connect to that thing. Maybe the network cable on your computer came unplugged—you'd just be wasting your time messing around with printing from different programs. Maybe it's a private printer connected directly to his computer with a USB or parallel cable and it's not shared or you don't have access to it—you'd be wasting your time messing around with trying to ping it or using different drivers.

Going back to databases, here's a real-world example of getting stuck too high up in the chain. Several experienced SQL people were helping a poster with a query where he was trying to show summary data from several tables at once, but he was getting sums that were multiples of the correct sums. Everything was complicated because he wanted some pivoting, but was doing it by joining to the tables multiple times instead of using case statement mini-machines to calculate the correct sums as the stream of rows passed by. (Here I go with a spatial representation again. I tell you, it really helps me.)

The reason he couldn't figure it out was that he was thinking of the query in terms of its structure after grouping instead of before. When there was more than one row to be grouped by for one table, and then he joined to another table (whether or not it had multiple rows per group), everything was getting cross-joined among the groups. He needed to step back and run his query without the group by clause, and see if the rows made sense before being collapsed into their defined buckets (there's more spatial framing again). If he'd done that, he'd have seen the cross-joining behavior and realized what the problem was. All the experts, myself included, forgot about that at first and started fiddling with the summing/aggregating stuff!

That was too high of a level. We hadn't even checked to see if the data we were trying to manipulate was in the correct form. And it wasn't.

So. Deliberately ordering one's own thought processes. The next time I am about to think about a problem, I'm going to stop thinking. Then I'm going to think about what I'm thinking about for a minute. Is this the right thing to think about? Am I making assumptions? Can I test those assumptions?

I'm going to back off from solving the problem and think about whether it's even the right problem to start with.


Alex said...

I think that we may think the same way about queries.

But when I am performing more tedious tasks I think to myself 'Ive gotta do 1, 2, 3'. 'Ok, done 1 now I've gotta do 2, 3'.

Which seems alright, except I keep telling myself the sequence of tasks. So until I get done 2, I am telling myself 'Ive gotta do 2, 3'. Sometimes, it makes me feel like some kind of moron. But, my SO is a psychologist and she says that is one of the least abnormal things about me. But she also says whether I'm a moron or not is open for discussion ;)

Anonymous said...

"The next time I am about to think about a problem, I'm going to stop thinking."

Are you my pointy-haired boss?

ESquared said...

Wow, you read that in 3 minutes? I'm impressed. Well, not really. I'm sure that if I was your pointy-haired boss, I would suffer from the relationship more than you. Just look at your attitude. So nasty. For no reason. How much do you want to bet that you're someone who doesn't like me from tek-tips, who came looking for a fight, just searching for some way to insult me? Prove me wrong and post a comment as yourself, clearly identifiable, without hiding under "no name."

I find it intensely amusing that this anonymous jokester is so bothered by my writings. And does he bother me a bit? I'm insecure enough to know that it does and secure enough to admit it: Yes. But I can laugh at myself! Perhaps I was being a tad overserious. But why sully my blog with nasty personal comments? That's far worse than anything I'm guilty of. It's cool how people show themselves up to be poor quality material, simply because they are poor quality material and everyone can see it. Cowardly poor quality material.

But there's really this thing I do to "set" something in my mind for future use. It's some kind of visualization/rehearsal thing. Making a deliberate note in my mind about how I want to alter my behavior in the future really does work. And the stronger the imprint I make, the more reliable the response and the faster I adopt it.

So that "The next time I am about to think about a problem, I'm going to stop thinking" was just my awkward way to try to capture that. It really is useful. If you don't know this technique, you're missing out on a way to maximize your own intelligence.