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.

  • Why don't you just rename the column in the database? (Or, why not fix the application, which shouldn't have been written with incorrect schema in the first place?) Apr 3 '14 at 23:59
  • I am new to this firm and the previous dba did not seem to have a good communication with the developers. I am kind of thrown into a crazy mess. As for renaming the columns in the database, the database is being accessed by other applications too, which refer to the database with current column name.
    – user33664
    Apr 4 '14 at 0:06
  • 3
    Still seems to me you're better off fixing the application, than creating a permanent, messy layer of indirection. Apr 4 '14 at 0:20
  • Regardless of future mess (which does not help me score points against the dev/business team), do I have performance hit if I use column aliases just to connect to this particular application.
    – user33664
    Apr 4 '14 at 0:26
  • Using a view will not directly impede performance all that much. If the application is critically dependent on getting the total utmost performance you probably want to modify it to use the actual tables, as Aaron noted above.
    – Hannah Vernon
    Apr 4 '14 at 0:35

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy