2

Does width of a column name really matter when I do select or insert or when I run stored procedure? Any performance implications with respect to column name width.

I guess the answer is No. But I still want to get more insights to it. May be different databases internally refer sql table column names differently. The answer which is true for MS Sql Server may not hold true for Oracle?

user1
  • 4,031
  • 8
  • 37
  • 66

1 Answers1

1

For SQL Server, I'm going to say "no". The name is just a reference into the metadata for the table that says what the column position and data type are. I'd venture to say it's the same for mySQL as well, but that's purely speculative.

That said, there's a saying in software in general that goes something like "imagine that the person who has to maintain your code is a homicidal maniac". So feel free to push the limits of the size of the column name. But keep that saying in mind. :)

Ben Thul
  • 31,080
  • 4
  • 45
  • 68
  • 1
    For reference, SQL Server's `sysname` is an `nvarchar(128)`, so it's up to 256 bytes. MySQL is limited to [64 characters](http://stackoverflow.com/questions/6868302/maximum-length-of-a-table-name-in-mysql) and Oracle limits you to [30 bytes](http://stackoverflow.com/questions/18248318/change-table-column-index-names-size-in-oracle-11g-or-12c) (supposedly because that's the standard defined limit, but I find that hard to believe). If name length even affects performance, it has to be pretty far down that list. Probably below immutable stuff like network overhead. – Bacon Bits Dec 06 '15 at 06:40