Category: Editorial

  • Are There That Many GUIDs?

    This editorial was originally published on Oct 12, 2010. It is being re-run as Steve is away on vacation.

    Do a lot of people actually use GUIDs as Primary Keys? I haven’t used them much, and I would have thought that more people chose identity keys. It seems that most of the demos and examples I see from bloggers and speakers are constantly using identities.

    However an informal survey from Peter Bromberg showed that four times as many people actually had GUIDs as their primary keys. The blog actually says that GUIDs are not a good choice, but I’m not sure I agree with that. You can use sequential GUIDs, and you can avoid making them the clustered key, so I think they can work as well as anything.

    There’s nothing inherently wrong with GUIDs, and they should be unique across all of your rows. There have been some reported cases of duplicates, but for most practical purposes, especially in database work, you ought to be able to count on a GUID as unique. They even have the nice capability of being generated by clients, removing the need for an extra round trip when a client needs to insert multiple rows.

    I typically don’t use them because they’re long, hard to remember and type, and hard to view on the screen. I can’t easily compare rows in multiple tables, and it’s easier for me to work with integers.  I don’t recommend them, but if you are going to use them, be sure you understand the pros and cons, and use them appropriately.

     

  • Common Mistakes

    At times I am rather dismayed by the quality of code I see written today. I’m not sure it’s worse than the poor code compiled early in my career, but there are so many more people writing code in our industry that it seems there is more and more poorly written code.

    We suffer from the chef problem. As more companies look to become software companies, they need to hire more software people. To meet the staffing demand, more and more marginally skilled people will be chosen, and software quality goes down.

    Part of what we do here is to try and educate the SQL Server professionals on how to become better at their jobs. That’s really the core mission that started SQLServerCentral and continues today thanks to the belief in that mission by Red Gate Software. As we look to do that, we want to bring to light the things that aren’t good ideas and can cause problems.

    What common mistakes do you see T-SQL developers making?

    The question this week is based on a post by the talented Doug Lane, who wrote about the top three mistakes T-SQL developers make. Doug has a good list, and I’d urge you to read it, along with some sage advice from Brad McGeHee. However I’m sure many of you see different common issues in your own work.

    What things need to be fixed later? What code regularly causes performance issues? The more specific problems that you can share, along with their solutions, the more you might help another developer build better code in the future.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 2.1MB) podcast or subscribe to the feed at iTunes and LibSyn.

  • Microsoft and R

    Microsoft purchased Revolution Analytics recently, a commercial company that works with the R programming language. This seems to be a decision to improve the analytics and analysis offerings from Microsoft. I’ve heard this will be incorporated into their Machine Learning offering, but I wouldn’t be surprised to see some basic R support in SQL Server at some point. If you’re not familiar with R, we’ve got a basic piece at SQLServerCentral on it.

    Microsoft has made lots of acquisitions before, and while there’s some question of whether Microsoft can make R easy to use, I think they can. Years ago, Microsoft bought Proclarity, a company that had some BI type products. Did they succeed with that acquisition? I think they did. A number of the technologies likely made their way into PowerPivot and Power View even though the Proclarity products have somewhat disappeared, being incorporated into other products.

    The R language and environment is complex, and I’m not sure how many database developers or DBAs want to become experts. However I do think that it could be possible to make the language easier, perhaps by building functions into SQL Server that help with the data analysis and computational features, and adding extensions in ADO.NET or other client libraries that might support easier rendering of visualizations.

    We have lots of tools to help here already, with PowerPivot and other related Excel add-ins, and I suspect that any offerings here will overlap with those products, but allow Microsoft to woo an even wider audience of data professionals.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 1.9MB) podcast or subscribe to the feed at iTunes and LibSyn.

  • Small Experiments in Data

    Amsterdam is trying to become a smart city, with technology and investments being made in ways that will (hopefully) improve the city living experience for residents. There are a lot of items mentioned in the article, but one of the main items that I think underpins the entire experiment is data.

    The piece notes that people and organizations can contribute to public data, which is then accessible by anyone that wants to build software or applications. The idea that groups can add to, and consume, data, is important. We need lots of data to better understand, and work with, our environment. We also need to ensure that the data is accessible widely otherwise it can be stifling to the innovations that people may dream about.

    Amsterdam is participating in the CitySDK, a project that tries to standarize APIs for cities. That’s important to avoid every environment having to reinvent their own APIs. This also means that software applications written by talented developers in one place might be easily ported to other locations. Ultimately, we might find that not only do our cell phones easily work in all locations, but specific applications that we have (perhaps for something like buses or grocers), might also easily port to other places.

    I also think this provides a lot of opportunity for those of us working in software. I can see that there would be lots of organizations that have ideas for applications, but lack programming skills. There may be lots of opportunities in the future for developers to work with those that dream of new systems by bringing an idea to life. Even if you donated your time, you could polish your development skills, your communication skills with non-technical people, and dramatically improve the impression your resume makes with potential employers.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 2.2MB) podcast or subscribe to the feed at iTunes and LibSyn.