Reputation: 8065
I am sorry if the question is somewhat newbish, I have little knowledge of databases.
I am working on a web based application to manage the organization users. The number of records will be 10,000-20,000. I wanted to add another column to the table to allow the staff to add notes to the users record, just in case. I assume this will not be utilized very often.
Will adding VARCHAR column to the table have a significant performance impact on the DB? Would you suggest separating the notes to another table, relational to the users table?
Upvotes: 0
Views: 74
Reputation: 1269773
Adding a large varchar()
column can have an impact on performance, but not necessarily. The key idea here is storing data on pages in the database. Reading a table requires reading all the pages that contain records. Normally, many records fit on a single page. If a record is quite large, then only a few records fit on a page. This can affect performance because more pages need to be read (for certain queries) or the records don't all fit into memory.
In any case, there are mitigating circumstances:
text
, then it is a separately allocated object.There are also methods to mitigate performance, such as putting the longer columns in a separate table.
So, the impact on performance depends on the overall size of the database, its structure, and how it will be used.
Upvotes: 1