AboutSoftware development, .Net, SQL Server, TDD, Agile, Community and other Odds and Sods
Archives
About Me
Mitch Wheat has been working as a professional programmer since 1984, graduating with a honours degree in Mathematics from Warwick University, UK in 1986. He moved to Perth in 1995, having worked in software houses in London and Rotterdam. He has worked in the areas of mining, electronics, research, defence, financial, GIS, telecommunications, engineering, and information management. Mitch has worked mainly with Microsoft technologies (since Windows version 3.0) but has also used UNIX. He holds the following Microsoft certifications: MCPD (Web and Windows) using C# and SQL Server MCITP (Admin and Developer). His preferred development environment is C#, .Net Framework and SQL Server. Mitch has worked as an independent consultant for the last 10 years, and is currently involved with helping teams improve their Software Development Life Cycle. His areas of special interest lie in performance tuning |
Wednesday, February 29, 2012Perth .NET User Group Meeting, Thurs 1st March: TSQL Developer TipsI’ll be presenting a TSQL developer focused talk at the Perth .NET User Group tomorrow (Thurs 1st March, 5:30pm). I’ll cover a few techniques for speeding up and improving TSQL code.
If you haven’t noticed, the UG web site is currently down (due to circumstances beyond my control). I’m trying to get it back up, but it might take a little while… Sunday, February 19, 2012HTML5 IntroductionThis HTML5 introduction, Dive into HTML5, also contains an interesting account of how certain HTML features evolved. For the most comprehensive read and all the details: HTML5 specifications (still being drafted). Monday, February 13, 2012SQL Server Maintenance Plans: Updating Statistics, A Simple GotchaOut of the box, SQL Server’s maintenance plans enable you to set up common maintenance tasks such as running a CHECKDB, backing up up databases and logs, rebuilding indexes etc. In terms of rebuilding indexes, there are two flavours: a reorganise and a full-blown rebuild (Reorganizing and Rebuilding Indexes). Reorganising an index is usually done when the index is not heavily fragmented. It is not uncommon to find a maintenance plan that first full rebuilds all indexes (regardless of fragmentation level, but more on that in a moment), and then subsequently updates all statistics. Not only is this unnecessary, it is actually worse than simply rebuilding all indexes! The update statistics task samples your data, whereas a full index rebuild also updates the associated statistics but does so by performing a FULL SCAN of your data. That’s right: updating statistics with the default setting of sample after a full index rebuild will leave you with (potentially) less accurate statistics. Rather than rebuilding all indexes regardless whether they need it or not, Ola Hallengren’s maintenance script contains a production tried-and-tested stored procedure SQL Server Index and Statistics Maintenance for rebuilding and reorganizing indexes and updating statistics. It has ability to run for a set period to fit into tight maintenance windows, set fragmentation threshold levels, and update statistics, such as unindexed column statistics that are not updated as part of an index rebuild. Highly recommended. Sunday, February 12, 2012SQL Server 2008 Very Large Databases: A few notes1) Has the table schema been examined to minimise storage space per row? Whilst obvious, it is surprising how much can be gained from this. (I’ve managed to halve the row sizes in a previous project’s data warehouse) Techniques include using the smallest data types possible: a) Use varchar instead of nvarchar. b) Use smalldatetime unless you need the precision. [The smalldatetime datatype is accurate to the nearest minute, whereas datetime has a precision of 3.33 milliseconds.] 2) Turn on database compression (this has a CPU overhead, but can reduce total database size by over half). 3) Turn on backup compression. 4) Ensure instant file initialisation is turned on. 5) * Use multiple file groups to manage backups. 6) * Place critical tables in PRIMARY file group to enable piecemeal restore (SQL Server 2005 onwards) 7) Use partitioning to break a table out into several pieces that can be stored on different sets of drives: rule of thumb is around the ’20 - 30 million rows per partition’ mark. Of course, this somewhat depends on the ‘natural’ partitioning key range (for example, 1 month per partition) 8) Have a clear idea of your high availability requirements (maximum downtime) up front, and validate your disaster recovery plans. Refs.
Sunday, February 05, 2012Bootstrapping and Reflections on Trusting TrustThe term "Bootstrapping" comes from the term "pulling yourself up by your own bootstraps" (Wikipedia). In computing parlance, a bootstrap loader is the code that initially runs when a machine starts, whose job is to load the rest of the operating system. [I can remember (just) old mainframes where the bootstrap code was entered by hand using switches on the front panel!] If you’ve never read Ken Thompson’s “Reflections on Trusting Trust” (his Turing Award acceptance speech), it’s definitely worth reading:
How did I get onto this topic? Someone asked the question “How can you write a compiler in it's own language?” If you were writing a new C++ compiler, you would just write it in C++ and compile it with an existing C++ compiler. If you were creating a compiler for a completely new language, you would need to write the new compiler in another language first. Usually this would be another programming language, but it can be assembly, or even machine code. If you want to bootstrap a compiler, you would generally write a compiler for a small subset of the language. Then in this minimal version of the language, you would write a compiler for the full language. This often occurs iteratively rather than in a single pass. http://en.wikipedia.org/wiki/Bootstrapping_(compilers)
There is an interesting article about bootstrapping a compiler from the ground up titled Bootstrapping a simple compiler from nothing.
Saturday, February 04, 2012Measuring/Comparing .NET Performance in Visual StudioI’m guessing everyone knows that Visual Studio (Premium and Ultimate Editions) has a code profiler built-in. But did you know you can use it to compare and show differences and improvements between profiling sessions?
There are also other commercial code profiling tools available from RedGate and JetBrains, and Eqatec (which has a free version). Thursday, February 02, 2012SQL Server Migration Assistant (SSMA) v5.2 ReleasedMicrosoft have recently released an updated version of the SQL Server Migration Assistant (SSMA):
Download SQL Server Migration Assistant (SSMA) v.5.2 There are migration whitepapers for each database product available here. Wednesday, February 01, 2012Windows 7 BinsI love it when Scott Hanselman updates his Ultimate Developer and Power Users Tool List for Windows. I saw Bins and immediately went and purchased it ($4.99 PayPal). For each program pinned to the taskbar, you can create a group and put four shortcuts in the space of just one regular pinned icon. You can even choose which is the default click program, or hover to see all the programs in the group. [The same author created the very useful (and free) Fences)] Monday, January 30, 201297 Things Every Programmer Should KnowI happened to be on StackOverflow perusing a few questions (not that I spend much time there, ahem!), and I came across this great List of freely available programming books, which includes 97 Things Every Programmer Should Know A few of my favorites are:
Thursday, January 19, 2012Perth .NET User Group Meeting, Thurs Feb 2nd, 5:30pm: Visual Studio and Team Foundation Server vNext Preview with Anthony BortonJoin us at the Perth .NET user group, Thurs Feb 2nd 5:30pm, where you’ll see what’s coming up in the next version of Visual Studio and Team Foundation Server. Anthony will demonstrate features from the Developer Preview versions of both Visual Studio and Team Foundation Server and whet your appetite for the Beta releases expected in February. Some of the things you’ll see include the new team explorer, code review workflow, exploratory testing, local workspaces and much, much more.
Anthony Borton is the lead ALM consultant for Enhance ALM Pty Ltd, an Australian consulting and training company specializing in Application Lifecycle Management and Microsoft Visual Studio. He has been working with Visual Studio Team System full-time since 2005 and has worked with a variety of companies ranging up to some of Australia’s largest companies and financial institutions. Anthony is a sought after trainer and has delivered technical training and consulting in the United States and all across the Asia Pacific region. He is a Microsoft MVP (Visual Studio ALM), a Professional Scrum Developer Trainer and a Microsoft Certified Trainer. Anthony also runs the QLD ALM Users Group and the Canberra ALM Users Group. In addition to the usual JetBrains license raffle prize, Anthony has arranged to provide everyone that attends our February user group meeting with an invitation code for the preview of Microsoft’s Hosted TFS offering. Monday, January 16, 2012Windows Azure Training Kit December 2011 RefreshThe Windows Azure Training Kit includes a comprehensive set of technical content including hands-on labs, presentations, and demos that are designed to help you learn how to use Windows Azure.
To coincide with the new Azure web site, Scott Guthrie's talk is worth watching: Keynote: Getting Started with Windows Azure Sunday, January 08, 2012Non-Uniform Distribution from a Uniform DistributionGiven a uniformly distributed random variable x (such as the output from a standard Random Number Generator), how do we generate some other non-uniform distribution, q(y)? Solution: Generate x, and take y = f(x). But how do we calculate f() given q() ?
The required function is the inverse cumulative distribution function given by: Example: Exponential distribution (to simulate the lifetimes of radioactive nuclei) So inverse is Ref. http://en.wikipedia.org/wiki/Cumulative_distribution_function http://en.wikipedia.org/wiki/Inverse_transform_sampling Saturday, January 07, 2012Windows 7: Reclaiming Drive SpaceNote: Everything that follows is performed at your own risk. If, like me and may others, you installed Windows 7 Service Pack 1 over Windows 7 vanilla, you probably have quite a bit of wasted space on your primary drive (around 1GB). This is obviously not desirable if you have a relatively small SSD as your primary OS drive. Given that it is extremely unlikely that anyone would ever remove Service Pack 1 and go back to vanilla, you can quite easily reclaim this space (Note: you will no longer be able to uninstall Windows 7 Service Pack 1):
Monday, December 19, 20112009, 2011 Mahler LecturesFor anyone interested in mathematics/science, the Mahler lectures for 2009 and 2011 are now available as pdf’s. They vary in complexity, but most have a wide audience such as Terence Tao’s “The Cosmic Distance Ladder”, which I attended in person when held at UWA. |
ContactMSN, Email: mitch døt wheat at gmail.com LinksFavorites
Blogs |