简体   繁体   English

列名宽度是否会影响Microsoft SQL Server / Oracle / MySQL中的SQL查询性能?

[英]Does column name width affect sql query performance in Microsoft SQL Server/Oracle/MySQL?

Does width of a column name really matter when I do select or insert or when I run stored procedure ? 当我selectinsert或运行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. 可能是不同的数据库在内部对sql表列名称的引用不同。 The answer which is true for MS Sql Server may not hold true for Oracle? 对于MS Sql Server是正确的答案对于Oracle可能不成立?

For SQL Server, I'm going to say "no". 对于SQL Server,我要说“不”。 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. 我敢说MySQL也是如此,但这纯粹是推测性的。

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. 但是请记住这一句话。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM