问候, 我想知道,如果最好在表中选择列而不是在表中使用select *来指定列,如果我将在查询中指定需要的列,我是否可以更快地搜索或检索记录? /> 在表中使用select *的缺点和在表中选择指定列的优点, 请对此提供帮助,我确实需要我的问题的具体答案,这将对我构建代码有很大帮助,并且我也希望我的查询能够很好地检索并连接到数据库, 谢谢..
Greetings, i want to know, if its better to specify the columns in selecting in a table rather than using a select * in a table, will i have faster searching or retrieval of records if i will specify the columns i need in a query? what is the disadvantage of using select * in a table and advantage of selecting the specified columns in a table, Please help me on this, I really need an concrete answer to my question, it will help me a lot in constructing my code, also i want my query to have good retrieval and connection to my database, Thank you..
推荐答案最好指定列,而不要使用*.原因之一是查询引擎可以更好地优化查询,知道列和类型是什么,而不必用宽*来猜测.当使用广泛的表或在查询中使用多个表时,这尤其重要.借助此信息,可以形成更优化且可能有效的TDS,并将其发送给请求的代理. 另一个原因是代码的可读性和维护性.您将明确知道使用了哪些列. It is better to specify the columns rather than using *. One reason is the query engine can optimize the query better knowing what the columns and types are rather than having to take a guess with a broad *. This can be particularly important when using tables that are broad, or when using multiple tables in a query. With this information a more optimized and possibly efficinet TDS can be formed and sent to the requesting agent. Another reason is for code readability and maintenance; you will know specifically which columns are used.
更多推荐
最好指定在表中选择记录所需要的列,而不是使用表中的select *.
发布评论