Jump to content

SELECT *, or SELECT col1, col2?


TEENFRONT

Recommended Posts

Hello,

 

Just a quick one

 

Whats quickest? my table has about 30 columns, and i only need 2-3 columns in my results, is selecting everything (*) quicker than just selecting 2-3 colums? 1-2 of the colums are indexed. I own and large site so little things like this might help with our serverload and memory usage.

 

Cheers!

Link to comment
https://forums.phpfreaks.com/topic/194369-select-or-select-col1-col2/
Share on other sites

well.. I'm no MySQL expert, but I'm sure the difference in speed between the two is no more than a few thousand milliseconds... if not more.  It wouldn't be enough to notice... depending on your server's CPU speed.

 

Ideally though, it's best to select only the columns you need so that when you're debugging you know exactly what columns you're working with instead of going back and forth between phpmyadmin and your script.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.