Swimminginthought

A place for all things technical and my mind..

Menu
  • About Me / Hire Me
Menu

Update 2: Programming and Database Mistakes

Posted on July 3, 2012 by Percy Kwong

The biggest mistake you can make to cause problems with performance as a developer is to use joins.  Inner or Outer Joins take up a lot of CPU.  The transaction queries also take over 1000% time to complete in many cases.

If you have to join tables, you need to revisit your DB architecture.  The worst thing you can do is to put a join into the code you send to the DB.  For example, I just recently came across a client that had an issue with one particular transaction take over 5 minutes and it still wouldn’t complete.

After examining the code, the client realized there were joins across 2 DBs.  When I originally asked him if there were joins, he swore up and down there weren’t.  I guess he finally decided to look at the code only to find a Join in the code.

After cleaning it up, the transaction went from 5+ minutes to less than 5 seconds.   So it is important to do code reviews people.

If you have to do a join at all (the worst thing you can you can ever do),  You need to review the DB architecture.  Hire a DBA people.  Have someone review your architecture.  You’ll save yourself some major pain in the long run.  That’s a promise.

… and you won’t look like an idiot when the application craps out.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Kubernetes install gotcha on CentOS-7.x
  • Infrastructure as Code using AWS Cloudformation
  • Does SSL matter? It does and it’s not just web encryption.
  • Apache can’t serve the .well-known directory
  • Cloudy with a chance of Meatballs
  • Resurrection of the Blog
  • Encryption type Matters with Deep Packet Inspection – solved
  • Completely off topic.. Just a personal note.
©2023 Swimminginthought | Built using WordPress and Responsive Blogily theme by Superb