Wednesday, August 30, 2006

So why does SQL server change execution plan?

Well, some hypotheses:
  1. SQL Server has artificial intelligence built in and wants to annoy the developers and DBAs by randomly changing execution plans for the query to make it slow and have developers and DBAs spend extra hours trying to optimize it.
  2. SQL Server has artificial intelligence built in and has a bias toward SQL Server performance ocnsulting. Since the rates dropped somewhat it decided it will torture full-time employees until they will hire a consultant with a decent rate.
  3. This behaviour was a part of SP4 and was designed to annoy developers and DBAs so they will upgrade to SQL Server 2005 as soon as possible, thus generating much-needed revenue for Microsoft.

Friday, August 25, 2006

Why does SQL server always change execution plan?

I just don't get it why does SQL server always changes execution plan.

I run

EXEC sp_MSforeachtable 'UPDATE STATISTICS ? WITH FULLSCAN'

and still cannot get the same execution plan as the last time. I don't think any data were changed since a few weeks ago. And why does the SQL server all the sudden start usign hash or merge joins and try to use parallelism? I worked a couple of days ago to optimize the query and I've got it down to 71 milliseconds. Today it is back to 600 ms. Is the solution to use the real database, for example Oracle?

Wednesday, July 12, 2006

Tuesday, June 06, 2006

Evil empire...

Just found in my code:
using System.Globalization;
I did not know we are using evil system of globalization. Gess what, the globalists are sitting in the ambush in all unlikely places...

Wednesday, May 24, 2006

Architecture Journal useless?

I found Microsoft Architecture Journal utterly useless for containing lengthy articles with only general statements and no strategic vision.

Friday, May 19, 2006

Can't spend 25 hours a week blogging?

Steve Rubel spends 21-25 hours a week blogging while also having a full time job as senior VP at Edelman. I realize I am just too lazy.

Tuesday, April 11, 2006

Friday, March 24, 2006

60% of Windows rewritten!

Microsoft will rewrite 60% of Windows according to this article.
Ouch! That hurts!

Wednesday, February 22, 2006

Luck-driven development

I found a term "opportunistic development" (Research Directions of Microsoft, November 2005) referring to writing a VB program in debugger and tweaking it to get desired results. This was referred to as Programming by Accident by the Pragmatic Programmers. But in line with XYZ-Driven Development pattern I decided to introduce a new term: Luck-Driven Development (LDD).

Wednesday, January 25, 2006

Tuesday, January 24, 2006

FreeMind

Mind Mapping (a.k.a. Thought Mapping) is such a great idea. I only started using it, perhaps, because I am backwards. I am using FreeMind, and it seems to be an OK tool, but I have not figured out yet how do I print from that tool.

Friday, January 20, 2006

Windows Messenger

Why in the world I still need to have Windows Messenger on my machine when I already have MSN messenger and Microsoft Office Communicator? Anyone here designed Windows XP?

Tuesday, December 20, 2005

Re-distribute a user control!

Finally, you can re-distribute a user control without having to create a custom control, which is explained in this article. VERY COOL!

Tuesday, November 29, 2005

Console lib

Is it a full month since I wrote last time to this blog? Wow, I must have been really bored...

Anyway, here is a wonderful library I found, that allowed me to write console c# applications the same way I could do that in C using conio.h library.

Friday, October 28, 2005

Binary counting with fingers!

Great poster: http://howtoons.net/archives/final/800binary.html
I can use binary counting to count up to 1023 with just two hands!

Thursday, October 27, 2005

I thought they were mock objects?

I am using mock objects for a while now, and I never felt any difference between mock objects and stubs. However, this blog seems to indicate that real mock objects are the objects based on behaviour testing.

So, only about 20% of my mock objects were really mock objects. Other 80% were stubs.

Wednesday, October 26, 2005

ASP style of development?

A lot of my co-workers complained about my ASP style in ASP.Net development. The only reason for such a complaint is that I am using data-binding statements on ASPX pages and user controls, like this: <%# DataBinder.Eval(Container.DataItem, "City")%>. I never use any server-side scripting code on the page itself, all server-side code goes to code classes. However I do like to use data-binding statements to achieve better separation of presentation from business logic. Indeed, what is the alternative? The alternative is to handle OnDataBound() events, find the controls within each row and manually set properties on them. This is not ASP style, this is VB6 style of developing Windows apps. Is it better? No, you still have your presentation mixed up with the business logic, the methods become very long, there is indeed a lot of code written to do something which I can easily accomplish by using data-binding statements.

I would actually go to the extreme by trying to separate business logic from presentation. I would not use any code-behhind. I'll have all pages and user controls inherit from pages, but I would prevent Visual Studio from coupling these classes to the pages. This way if I add a control to the page it will not automatically appear in the class. All events should be registered by using control's attributes, like "onclick". The protected control variables will appear in the base classes only when I need to read properties of the controls. This way we can have the same base class for multiple pages or controls, avoiding duplication of the business logic, while being less strict about presentation (where some duplication is always allowed).