views:

289

answers:

6

What effect does a field name length has on the performance of a database? Is it negligible? Should I go with long descriptive names?

+1  A: 

Be sensible - make field names long enough so that you know what they represent, but short enough that you don't have to scroll for a half hour to the right to see what the column is.

Galwegian
+1  A: 

You can get academic and discuss the time the query parser needs to read the query, but really... long names do not have any influence you should be worried about at all.

Tomalak
+3  A: 

The database server converts field names into an internal representation. So the only time the name's length affects performance is when the server parses your SQL statements. The performance impact of this is negligible for typical applications.

Diomidis Spinellis
+3  A: 

I haven't measured the time, but I would imagine negligible. The field names are going to be sent back and forth over the network, both in your SQL statements TO the database and in the metadata that comes back FROM the database, but I think the incremental difference that a few bytes makes in those packets is below the threshold of caring.

Pity the poor humans that have to read your code, and make the names descriptive. Let the computer to a tiny bit of extra work.

Corey Trager
+1  A: 

Internally, the query processor uses numbers for field names once the tokens in the query are parsed, There are no sensible performance gains in short names on database objects.

Ovidiu Pacurar
+1  A: 

If you are using inline sql or an ORM there would be some impact due to additional information being sent back and forth on the network; but we're talking really negligible.

Giovanni Galbo