|For some time, I have been pondering the use of NOT EXISTS in my subquery statements.
A friend of mine guided me towards this method of excluding certain records quite a while ago. So I have been using NOT EXISTS but did not quite fully understand the difference between NOT IN and NOT EXISTS.
In my particular situation a query with a four table join needed some optimizing plus certain records excluded from the query.
I played around a bit and found that using NOT EXISTS produced a substantial difference in performance. Using NOT IN on the where clause of the query took in this case 9 minutes and 35 seconds.
Using NOT EXISTS produced the results in exactly 688 milliseconds.
This is a monumental difference.
I also got a very clear understanding of what’s going on when I came across this post: NOT EXISTS vs NOT IN.
While the post ascertains that in certain circumstances, there is no difference between the two, the best thing is to test both. I will forever keep this in mind. Thanks to my colleague Bill, to Gail from SQL in the Wild and a mention to the O’Reilly book Oracle Performance Tuning which also directs you in this path. The book is authored by Mark Gurry and Peter Corrigan.
So this is what we’re talking about:
Join [table2] on [table1.column] = [table2.column]
Where condition1 = ‘x’
That took a whopping 9:35 minutes to complete.
Whereas the query below, took all of 688 milliseconds!
Join [table2] on [table1.column] = [table2.column]
Where condition1 = ‘x’
I think in this case, we know who the winner is!
Some time ago, I related the following:
My office environment and its upside
I work in an office where cubicles are spread out as far as the eye can see. This environment affords the opportunity to talk to your team mates and hash out project issues without having to go all over the place looking for a specific person.
The Down Side
The down side is all the distractions generated by lots of people either shouting across cubicles, phones ringing, and yes, team mates talking to each other.
Cubicle conference calls are the death knell of productive programming. For quite some time now, I and others have noticed the amount of scattered chatter that breaks our concentration. Once you pay attention to something like this, every time you hear it, not noticing it becomes a task. A very distracting one. Just like a leaky faucet!
What do to about it
If you are in the same boat, here are some ideas that may help.
- Put headphones on
- Check email twice a day
- Tell everyone
- Turn spam filtering on
- Banish Growl
- Create IM office hours
- Silence your phone
- Eat lunch out of the office
- Become an early bird
- Clear your desktop
Want to know more, go here: Eliminating Distractions
My current solution
Since then I have obtained at least three pairs of headphones, together with binaural beats for my iPod and other apps for the iPhone! I’m currently using iBrainWaves on my iPhone together with my Bose Noise Cancelling head phones (QC 15).
They are not cheap and they cost even more due to the fact that I bought two other pairs of headphones, one in-ear, another over the ear which was quite effective by just putting them over your ears but not comfortable to wear all day.
I have gained some control over my environment once again and can now focus on the task at hand. I was not this sensitive to chatter before. I just seem to loose my concentration while programming, designing, troubleshooting code when conversations around me get going.
I’m curious, is anyone out there is experiencing lost focus and being distracted from the task at hand by your surroundings? What you’re doing about it? Have I become affected with ADD all of a sudden?
If you happen to stumble upon this note, share your thoughts. I’m open to suggestions.
My headphone use has increased. The chatter is gone to the point that when I have them on, folks have to come and tap me on the shoulder to get my attention. That can be good or bad. Will I here the fire alarm when it goes off? Everyone in the office leaves and I will not know about it? 🙂
I have been running Windows 7 for quite a while. Beta, RC, RTM and all these months went very smoothly.
For the first time, frustration and Windows 7 came to the fore. I lost my virtual machine. Specifically Windows 7 crashed and was never able to recover. I had antivirus software installed so I do not suspect any electronic skulduggery.
The antivirus software installed on this particular box was McAfee’s Beta 4.0. I did notice that I had some trouble updating the software and Windows would lock up often when trying to update the virus definitions.
Being the I have the OS running on a virtual box may have something to do with it but I chose to quickly re-install as all recovery attempts failed. I have a new install now and everything is back to normal.
I’ll keep track of how many times this happens in the environment I’m working.
That is 97 things a project manager should know.
I recently participated in a webinar that dealt with the subject of what I project manager should know, or at least consider to insure success of his/her projects.
It was quite a lot of information and yet useful. There is a book of the same title: 97 Things Every Project Manager Should Know. While the presentation in the eyes of some was lackluster, I did my best to try to get the most out of it.
I’m an application developer, but definitely take the role of Project Manager often enough to warrant exploring this subject in depth. Every project has it successes and failures and sometimes the entire project bombs. Following most tips if not all will most assuredly make our lives easier.
Some things just stand out. The question was asked: Where are the users? In typical fashion we plan, design, code and when we’re ready to unveil our wonderful creation, it surprises everyone. Is not what they expected! Along the way users should be included and know fully what’s going on. It’s amazing how many times, at least part of the user groups, by circumstance or happenstance are excluded from the design process.
Egos are bruised, folks are upset, and the project needs to be rescued. An application may finally go into production, but at what cost? How much work after going live is devoted to fixing or changing things? That measure is a tell tale sign of what was left out in the design process.
So off to explore those 97 things I go!
One of the many facets of development involves testing you applications, programs, games. Whatever grand program you have created to improve the world (at least your company’s bottom line), needs testing.
Development machines are somewhat different than what users at large may have. In a corporate environment, regular desktops will probably be locked down and many restrictions will be placed on users ability to install, download and many other things.
Having more than one desktop on hand is costly and cumbersome (space wise).
Virtual Computing to the rescue. I really like using virtual machines. My latest Virtual Machine is running Windows 7. I’m using the Sun Virtual Box. I can use all my peripherals and it’s very stable. I can test my web apps on this machine with different broswers, settings and such. This prevent my development machine from getting ‘corrupted’, so it can do what it does best.
Recently I had a bit of trouble connecting to a database from a web server. All parties involved had done their part as far as opening ports, database clients were in place (Oracle) and it seemed that we were good to go.
Using old and tried tools like IpConfig, Tracert, Ping and PathPing came to the rescue. While these are not programming tools per se, they are often used by System Admins and Network Engineers, it does not hurt to know their use.
So on this little discovery I found out that the IP address of the database we were trying to connect to was completely wrong. Once I corrected that, other issues had to be solved.
Now that we knew we had the righ IP Address, we were still not connecting. After delivering some information obtained via Tracert, we were able to determine what the problem was. The ports on the web server had been opened on the wrong subnet IP Address.
You may have your code ready to go but simple old tools like the ones above saved the day.
If you need a refresher on what this tools do look up this link: Trace Route