amedhussaini Posted April 20, 2008 Share Posted April 20, 2008 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 More sharing options...
p2grace Posted April 20, 2008 Share Posted April 20, 2008 It queries whatever you specify it to query. Therefore the less data (the fewer columns) the quicker the query would run. Link to comment https://forums.phpfreaks.com/topic/102042-query-speed-question/#findComment-522219 Share on other sites More sharing options...
monkeypaw201 Posted April 20, 2008 Share Posted April 20, 2008 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 More sharing options...
dptr1988 Posted April 20, 2008 Share Posted April 20, 2008 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 More sharing options...
amedhussaini Posted April 20, 2008 Author Share Posted April 20, 2008 thanks for the replies guys, most helpful, as always Link to comment https://forums.phpfreaks.com/topic/102042-query-speed-question/#findComment-522319 Share on other sites More sharing options...
redarrow Posted April 21, 2008 Share Posted April 21, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.