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
  • 227,407
  • 48
  • 383
  • 507
Jeremy Roy
  • 1,241
  • 5
  • 18
  • 30

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
  • 837,282
  • 173
  • 1,862
  • 1,933
1

It won't affect it the slightest bit.

Denis de Bernardy
  • 72,128
  • 12
  • 122
  • 148
1

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