How to Create an Empty Table and Fool Optimizer to Believe It Contains Data? – Interview Question of the Week #204

Question: How to Create an Empty Table and Fool Optimizer to Believe It Contains Data?

Answer: Before I answer this question, I must acknowledge that I have never heard this question in my 20 years career before and I must ask you back, where do you come up with these kinds of questions.

Read More

Does Sort Order in Index Column Matters for Performance? – Interview Question of the Week #199

Question: Does Sort Order in Index Column Matters for Performance?

Answer: Wow, it has been a long time since I have heard this question and the matter of fact, I have never blogged about this subject on this blog. I have received this question during my recent Comprehensive Database Performance Health Check.

Read More

SQL SERVER – FIX: Arithmetic Overflow Error in Object Execution Statistics Report in Management Studio

Many times, there are unforeseen conditions and few developers can’t predict which writing the code of a product. This is the reason we have bugs in the products and we all have job to do. One of my clients was not able to run one of the inbuilt reports which come with SQL Server Management Studio. The report name was Object Execution Statistics. As per them, this report was running fine until last week and it had suddenly stopped working. They wanted some idea this as it was not a show stopper for them. When they launch the report, they see below error

Read More

SQL SERVER – CLONEDATABASE: Generate Statistics and Schema Only Copy of the Database

I have been writing about how some of the interesting enhancements made with SQL Server 2016 SP1 have caught my attention. This one is a killer feature that can be of great value when you are trying to do testing. Having said that, I also want to call out that this feature has been added with SQL Server 2014 SP2 too. When you get into performance problems related to the query optimizer, then this capability will be of great advantage. In this blog post we will learn about Generate Statistics and Schema Only Copy of the Database.

Read More