In a previous post I talked about becoming an active reader by taking part in and examining the communication between author and audience. Today I’m going to explore it.
Topic William Zinsser said it best when he said “think small”. While he was talking about writing a memoir, thinking small applies to anything that you write about. Am I going to be able to effectively write about something as complicated SQL Server’s cost based optimizer in a single blog post?
Tom LaRock’s recent post – SQL University – Creative Writing Week – got me thinking about the act of writing. Although interesting, his post sparked two thoughts in my head – about reading and inspiration.
Reading I love reading. There have been years when I’ve read over 100 books. Admittedly, I was required to read about 60 of those for college. But reading, in and of itself, didn’t make me a better writer.
This is a letter, or a rant, to any ISVs in the world who encrypt their stored procedures. It is, by no means, a condemnation of this horrible feature of SQL Server. The feature condemns itself. I saw something in a blog the other day (that I wish I could find it again) where the author essentially said that encrypting stored procedures is an absolute necessity. I couldn’t help but incredulously think “Really?
[caption id=“attachment_1437” align=“alignright” width=“150”] Take three steps to your right to advance to the next slide[/caption]
Honestly, I’m tired of speaking. PowerPoint is overrated. People want more or less bullet points. It’s never enough. More graphs. More pie charts. Less funny images. More dinosaurs. Stop showing pictures of Zeus sexing up a goat. I don’t know what you people want!Demos – you can shove those, too. People complain when the code doesn’t fit on the screen or when my resolution is too low or when they have some kind of vitamin deficiency and they can’t look at the color #0f0015 for more than 32 seconds without suffering from a migraine.
[caption id=“attachment_1397” align=“alignright” width=“200”]Are we not men? No, we are Hammurabi![/caption] What are you doing right now? How many different things are you trying to balance? Stop all of them and pay attention. No, seriously, do it. Nobody is going to die in the next five minutes. Unless you’re in surgery or something. In which case go do your job. I’m here reminding you that you need to pay attention. This isn’t like in Middle School history when you were learning about the Epic of Gilgamesh and how he killed a demi-god with the help of a hairy little man and together they survive watching the movie Ishtar and end up wearing a cow’s ass as a hat or something.
[caption id=“attachment_1407” align=“alignright” width=“145”]Fact: the earliest recorded use of cloud computing was ancient Greek porn.[/caption] Io was a nymph. True story. Apparently, her father was some kind of river god. In modern times that means you’re likely to catch fire. Back in the days when the Greeks were in charge of things being a river god meant that you were somebody (the Greeks thought the earth was a giant brass plate floating a huge river, all of which was created by perverts who lived on top of a mountain).
David Stein started this current blog meme. He passed the buck on to Brent Ozar, who shared a horrifying tale of his time in the trenches as a developer. Brent then thoughtfully pointed at me and demanded that I carry on the blog meme torch. Blog memes are great. They give me an opportunity to pretend to be inventive and creative, take someone else’s great idea and spin it in a centrifuge to extract the good stuff and then pass the detritus along to someone else to deal with.
A lot of people use calendar tables. I’ve blogged about it before. They’re incredibly helpful. Now, have you ever needed a table of minutes? You’re probably asking, “Jeremiah, why the heck would I ever need a table of minutes?” Well, dear reader, I’m going to tell you that. Please stop interrupting. Let’s say you have a report. This report shows the sum of sales per 5 minute increment. You could do a lot of trickery with math to make this report happen, doing things like this to get the 5 minute interval:``` SELECT (DATEPART(mi, CAST(‘2009-01-01 00:01:00’ as datetime))+4) / 5 * 5 AS [05]
Putting functions in the where clause of a SQL Statement can cause performance problems. If you aren’t careful, these problems can add up and bring a powerful production system to its knees. For this example, I’m using the Northwind database, but you could do this on any database. The first thing to do is put an index on the OrderDate column:CREATE INDEX IX\_Orders\_OrderDate ON dbo.Orders (OrderDate) ;Take a look at this first query:SELECT COUNT(\*) FROM dbo.
This is a pretty simple process, but one that I thought I would document because I ran into a few gotchas along the way. I originally installed OS X using the one click installer from EnterpriseDB. Unfortunately, the installer hung while attempting to finish the installation process and they only thing to do was to roll back the install. I attempted to build from macports, but that proved to be a huge pain in my ass and reminded me a little bit too much of using Linux, so I scrapped that idea as well.