Jump to content

query speed question


amedhussaini

Recommended Posts

lets pretend we have a table with a lot of rows with a lot of columns in each row.

 

is it faster to do a |select * from table where 'variable' = '$variable'|

or

|select blah1, blah2, blah3 where 'variable' = '$variable'| ?

 

it seems logical that the second would be faster, since you dont have to return as many columns, but i was thinking, does mysql return all the columns anyhow in each row then parse out the columns you really want before it dumps it into a $result?

 

i hope that makes sense.

 

cheers,

amed

Link to comment
https://forums.phpfreaks.com/topic/102042-query-speed-question/
Share on other sites

It queries whatever you specify it to query.  Therefore the less data (the fewer columns) the quicker the query would run.

 

Agreed, but just out of curiosity, how many rows? because you shouldn't see a big slow-down unless you are looking freaking massive tables... i run a 500 query script in a few minutes updating 17 columns across...

 

Just asking..

Link to comment
https://forums.phpfreaks.com/topic/102042-query-speed-question/#findComment-522251
Share on other sites

There are many variables that can affect query speed. One of the best ways to determine the speed of a query is to just test it yourself. Infact you don't even have to write a PHP script to time the query,  can just use the 'mysql' client. It will tell you how long a query to execute.

Link to comment
https://forums.phpfreaks.com/topic/102042-query-speed-question/#findComment-522261
Share on other sites

I was also worried about database speed, But i come to relise setting

up a deadecated database server solved all my problams.

 

Speed factor relies on the the database server aswell, for the data and info to be process via the  database server ........

 

I strongly suggest if it a large database needed, Get a deadecated server...........

 

I personly think free hosting and shared hosting use database server's with php as one.......

 

 

Link to comment
https://forums.phpfreaks.com/topic/102042-query-speed-question/#findComment-522325
Share on other sites

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.