SQL Server – Performance Hit with Column Alias

aliassql serverview

I have a database in SQL Server 2008, with the final data table having about 2 million rows. The development team is implementing a new application and they have suggested changing the column name to reflect what the business likes it to be. They already have their application built in the test environment with the new column names. Will there be a performance penalty if I have them connect to my database via a view with column name aliased to match the column names used by the application? I need to provide a justification for not to change the column names in the application. Any help will be appreciated. Thanks.

Best Answer

A view, being just a query persisted in the database, should not theoretically have any performance hit. Same is true for column or table aliases. The performance hit, if any, will be barely noticeable once the execution plan is compiled and cached by the database engine. So, there is no performance justification not to use column aliases based on views. Having said that, I second Aaron Bertrand that the application should not have been written in incorrect schema. I would fix the application just for the sake of best practices and not to "create a permanent messy layer of indirection" as Aaron Bertrand said.