4

For example, I have a database like this:

id | fname | lname | sex | age | tel | 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?

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

Thanks.

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
Jeremy Roy
  • 1,291
  • 5
  • 18
  • 31

3 Answers3

9

That won't make any difference.

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

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
1

It won't affect it the slightest bit.

Denis de Bernardy
  • 75,850
  • 13
  • 131
  • 154
1

Another thing that will make it run faster is creating indexes on the fields that you will be searching the most.