select语句中的列顺序是否会影响查询速度? [英] Does the order of columns in a select statement affect query speed?

查看:92
本文介绍了select语句中的列顺序是否会影响查询速度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我有一个这样的数据库:

For example, I have a database like this:

id | fname | lname | sex | age | tel | cell | address

如果我执行select cell, fname, address, sex而不是select fname, sex, cell, address,这会影响大表中的查询速度吗?

If I do select cell, fname, address, sex instead of doing select fname, sex, cell, address, will that affect the speed of query, in big tables?

我在phpmyadmin中进行了快速检查,这似乎花费了相同的时间,但是我想再次检查.

I did a quick check in phpmyadmin and it appeared to be taking same time, but I wanted to double check.

谢谢.

推荐答案

那没有什么区别.

但是,省略SELECT子句中的列将使其运行更快,因为它将通过网络发送较少的数据.

However, omitting columns from the SELECT clause will make it run faster since it'll send less data over the network.

这篇关于select语句中的列顺序是否会影响查询速度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆