Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Table name or column name length affect performance?

I'm using MySQL + Hibernate.

MySQL table name length and column name length affect application performance ?

exmaple)

#1
awd (table)
id int,
awd_nm varchar(...),
tit varchar(...)

#2
award (table)
id int,
award_name varchar(...),
title varchar(...)

which is better ?

like image 656
drypot Avatar asked Apr 23 '11 07:04

drypot


People also ask

How long should a column name be?

Per the documentation, the maximum length for a column name is: 64 characters.

Does number of columns affect performance in mysql?

Yes, extra data can slow down queries because it means fewer rows can fit into a page, and this means more disk accesses to read a certain number of rows and fewer rows can be cached in memory.

How long can column names be in SQL?

Each object has maximum size limitations. SQL maximum column name length limitation is 128 characters. If we create more than 128 characters, it shows an error. The total number of columns limitation is 1024.

Can column name be same as table name?

Its a limitation of the language, no, you can't rename it Customer. A class cannot contain a property or field with the same name of its containing type.


1 Answers

No it will not, not to any degree that you can measure.

Spend more effort making your schema easy to understand. You'll gain more in the long (and short) term than the unmeasurable femtoseconds you'll gain with shorter and unreadable schema names.

like image 62
Michael Petrotta Avatar answered Nov 15 '22 23:11

Michael Petrotta