Foreign key indexing

Foreign keys are an essential part of a relational database. Foreign keys helps ensuring the data integrity at the logical level. However many time we forget to create proper indexes that support the foreign keys work effectively. So is there any benefits of indexing the foreign key columns?  It can give… Continue Reading Foreign key indexing

What makes a query SARGable?

What is SARGability? The word SARGable comes from the term “Search ARGumentable”. This tells if an item can be found by using an index, provided such an index is available. Understanding sargability can really impact the  ability to write well-performing queries. If a WHERE clause is not sargable, the Query Optimizer… Continue Reading What makes a query SARGable?

Union v/s Union All

Often many ask, what is the difference between union and union all? Union operator combines multiple resultsets into one resultset. Union also removes the duplicates and returns a sorted result set. Union All  operator combine multiple resultsets into one resultset, but it does not eliminate the duplicate rows.  Since the duplicate… Continue Reading Union v/s Union All