gpt4 book ai didi

php - 哪个更快 : "SELECT * FROM table" or "SELECT x,y,q FROM table" (from a table with 4 fields)

转载 作者:可可西里 更新时间:2023-11-01 06:55:55 27 4
gpt4 key购买 nike

我想知道,什么是最快的(或数据库处理的最轻的)

比方说,数据库表有 4 个字段:x,y,z,q

我只需要 3 个:x,y,q

数据库执行哪种方式最快/最简单(使用 PHP)..“SELECT * FROM table”还是“SELECT x,y,q FROM table”?

如果表格有 5 个或更多字段,而我仍然只需要选择 3 个,是否同样适用?

最佳答案

SELECT x,y,z FROM table 更快,因为 MySQL 在执行查询之前不必查找表中的列。

关于php - 哪个更快 : "SELECT * FROM table" or "SELECT x,y,q FROM table" (from a table with 4 fields),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10518413/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com