I have 60 columns in a table.
1). I want to add one more column to that table. Will there be any impact on performance?
2). How many columns can I add?
3). any idea for the avoid recursion. [I have no idea here - annakata]
I have 60 columns in a table.
1). I want to add one more column to that table. Will there be any impact on performance?
2). How many columns can I add?
3). any idea for the avoid recursion. [I have no idea here - annakata]
Yes, but one more column is less of a problem than the fact that you already have 60.
I bet most of them are nullable?
With very wide tables (many columns) it becomes harder to write maintainable SQL. You are forced to deal with lots of exceptions due to the NULLS.
See also this post which asks how many fields is too many?
If I were you I would be less concerned with the fact that you have to add one more column, and more concerned with deciding whether 60 columns is appropriate.
Will there be any impact on performance?
If you are adding a "Notes" type TEXT column, or a Blob storing the Image of a User, and most/many of your queries are SELECT * FROM MyTable then you will definitely be creating a performance issue.
If you always explicitly only name the columns your qurey needs, like: SELECT Col1, ColX, ColN FROM MyTable, then adding a new column will have little to no impact on performance - but wider rows mean fewer records per data page, so there is SOME impact, and if you are adding an Index to the new column then that index has to be maintained too - but if your application needs it then that is a necessary "cost".
We have plenty of tables with > 60 columns. However, I would like to think that that is By Design, rather than because the table has just grown willy-nilly.