top of page

Reviewing queries - columns, joins, tables and indexes

  • Repost - originally posted 29-08-2012
  • Oct 16, 2017
  • 1 min read

Whilst rewriting a lot of T-SQL code to allow a client to change their report delivery mechanism, what we found is that the current queries return columns that are not used. This may have been because some queries had been copied from others and have never been reviewed or refactored. For more efficient code we have removed these columns that were not needed. As we removed the columns we also found that there were tables and therefor table joins that were no longer required. So the joins got removed as well and some tables. We then made sure that the columns on every table join were also indexed.The result is leaner, more efficient, quicker and more manageable code.


 
 
 

Recent Posts

See All
Cardinality estimator

Recently I was asked by a software vendor to review a particular query that ran in under a second on a SQL Server 2014 installation at a...

 
 
 
Index fragmentation

A law firm client, occasionally has issues with their legal software, that is provided by the global leader in this field. The response...

 
 
 
Deleting large amounts of data

I had a client call me about wanting to delete a large amount of data from their database. They knew what tables they wanted to delete...

 
 
 

Comments


bottom of page