Does the length of columns name in database has any impact on the query performance ?

Does the length of columns name in database has any impact on the query performance ?
Tech NoviceAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ares KurkluSoftware EngineerCommented:
The length of the column name won't impact the query performance it will be highly insignificant, it is more important how you query from the tables. Like:
instead of doing
select * from table
better to specify the columns that you need in the query
Scott PletcherSenior DBACommented:
Yes.  The biggest impact is on memory usage.  SQL estimates required memory before a query runs and then allocates that much memory.  Part of SQL's estimate is based on column size, which is perfectly logical, of course.  You don't need to be hyper-accurate, but don't way over-allocate either.  

Varchar(max) columns are roughly twice as long to process as varchar(nnn) columns, even if they have less than 8000 bytes.

Using varchar instead of char for very short columns also hurts performance.  For example, for a (United States) state code, use char(2) not varchar(2).
arnoldCommented:
column name is a label no performance impact.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Scott PletcherSenior DBACommented:
Ooh, yeah, I misread the q, I thought it was about actual column length -- varchar(10) vs varchar(8000) -- not the length of the column name.

Quite right, the length of the column name doesn't effect performance, certainly not enough you'd ever be able to tell.
pcelbaCommented:
Column name length can impact the query performance but at COMPILE time only. So when you use e.g. OPTION (RECOMPILE) or create a SP WITH RECOMPILE then you may observer differences in compilation time when the same query uses short vs. long column names.

The same rule is valid for commands used in SQLEXECUTE() and similar techniques like commands passed via ODBC.

BUT remember visible difference can appear when we will talk about hundreds of columns in one query.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tech NoviceAuthor Commented:
Thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.