Posts

Why table can have only one clustered index? No it is not what you think.

Image
Recently, I have been on an interview spree to get a DBA on board in our team. And this was one of the question I asked to nearly everyone. No, not only because this is my favorite question but also because it is a one of the litmus test that help me estimate how clear a DBA is about the core concepts of RDBMS. Problem How many clustered indexes can table have and why? Or. Why a table can have only one clustered index? Below is the most common answer I got for these question: “Because we can have only one primary key on the table”. Well, that answer is a big NO. Yes, NO THAT IS NOT THE CORRECT ANSWER. Surprised, well I was too when I use to hear that answer. Yes, it is correct we can’t have more than one primary key on a table but that is due to its definition and functional requirement. And that’s why by default SQL Server provides functionality of creating a clustered index along with it. My obvious next question to them was “Can we create a primary key without a cluster

Happy New Year 2021

Image
 Wishing all my readers and viewers a very  Happy New Year 2021

Starting with SQL Server

Image
Greetings everyone, it's been nearly one year down the line when I launched my YouTube channel and really happy to see that it is also helping many people to start their journey with SQL Servers.  So if you're also looking to start your own journey with SQL Server here is the playlist for your reference. The set of videos in this playlist not only helps in setting up or installing SQL Server but also on how we can connect to SQL Instance using SSMS and start working with it. So, best of luck for your journey. Starting with SQL Server Happy Learning!

How to install SQL Server 2017

Image
Greeting everyone. I'm happy and excited to share that I've launched my YouTube channel with name SiddTechnolog on October, 8th. I've started off from the very beginning of SQL Server i.e. installation. In this video I've showcased how to install SQL Server 2017 developer edition on Windows 10 based desktop machine. Not only I have shown options related to a desktop based installation but I've also tried to cover options you should be careful about when you do installation on a Windows Server based machine. Moreover I've also provided explanation on what and why we're choosing a given options. So what are you waiting for, go over the video and exalt your SQL Server installation skills. Please do not forget to hit the like button if you like the video and click on subscribe to stay updated on latest uploaded videos. Please feel free to suggest topics you would like to cover me in videos or as blog. See you soon.

SQL Server Statistics and smart way to update it

Anybody who has worked with SQL Server databases whether be it administrator or developer, knows the significance of having “ statistics ” on a table and how it greatly impacts SQL query performance. Below are some excerpts about “ statistics ” from SQL Server documentation . “ Statistics for query optimization are binary large objects (BLOBs) that contain statistical information about the distribution of values in one or more columns of a table or indexed view. The Query Optimizer uses these statistics to estimate the  cardinality , or number of rows, in the query result. These  cardinality estimates  enable the Query Optimizer to create a high-quality query plan. ” “ Statistics ” is a complex amalgamation of histograms and densities that helps SQL Server Query optimizer correctly estimate number of rows it may fetch and process for each operator in order to generate an optimal or near optimal execution plan . Estimation plays huge role in how much time each operator wil