• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

can the length of a column name affect db performance?

I'm just wondering about this.. Say I have a db with 30 columns, and each column name is 25 characters.. if there were, for example, 10 million records, how would performance compare to a db with the same about of data and number of columns, except that the columns were only 10 characters long.. does this really matter?
 
Doesn't make a difference. The names are just used as pointers to locations on disk, it's not like it stores the name of each column along with each record.

If you have a column of integers, each four bytes, and call it "Supercalifragilisticexpialidocius", each of your integers is still only four bytes long, and it still takes the computer the exact same amount of time to skip 4 bytes ahead to the next integer. The column name is only in there once, not with each record.
 
thanks for the replies... i was being criticized by a dba in table design for having long column names... i didnt think it mattered. there are alot of tables and alot of columns and alot of code, and I was using descriptive column names to make parsing the code and knowing what each field was alot easier to decipher...
 
I haven't tried this, but it might seriously bulk up XML transfers of the database if it's a simple export that writes those long names for each record.

<record>
<employee_id> 1234567890 </employee_id>
<my_really_long_name_for_person_lastname> Smith </my_really_long_name_for_person_lastname>
<my_really_long_name_for_person_firstname> John </my_really_long_name_for_person_firstname>
</record>

And column names like that could make looking at a sheet view of the table hard to read.
 
DaveSimmons makes a good point, and it has been awhile since I messed with getting XML straight from SQL server (I prefer to use the DBMS' natural interface, and translate to XML at the middle tiers), however I believe you can define the mapping such that you get shorter column names.
 
this app wont be using xml.... basically, i get to avoid commenting each instance of a column if I use the more descriptive name, which "to me" makes my code easier to read and manage...
 
Originally posted by: TechBoyJK
thanks for the replies... i was being criticized by a dba in table design for having long column names... i didnt think it mattered. there are alot of tables and alot of columns and alot of code, and I was using descriptive column names to make parsing the code and knowing what each field was alot easier to decipher...


DBA's hate long column names because typing them is a pain in the ass and most DBAs are allergic to GUIs so they will be typing them a lot 8)


One thing to consider though is that having really long column names for short columns will really annoy people are trying to view tabular data. For example, FLAG_TO_INDICATE_CUSTOMER_HAPPINESS is a particular awful name for a boolean column.
 
Back
Top