zgkhoo Posted November 25, 2007 Share Posted November 25, 2007 function setpyramidbonus($cardID,$pyrtable){ echo "</br>enter set pyramid bonus"; $result=mysql_query("SELECT * from $pyrtable ORDER BY PID"); while($row = mysql_fetch_array($result,MYSQL_ASSOC)){ if($row[serialnum]==$cardID){ echo "</br>row upline=".$row[uplineSerial]; $levelcount=1; loopupline($row[uplineSerial],$levelcount,$cardID,$pyrtable); } } very slow n slow n slow for this funciton when the $pyrtable's record is too big which consist of above 10000 record..any solution to deal with large db? thanks Quote Link to comment https://forums.phpfreaks.com/topic/78754-how-to-deal-with-large-database/ Share on other sites More sharing options...
zgkhoo Posted November 25, 2007 Author Share Posted November 25, 2007 $sql = "CREATE TABLE pyrmain ( PID integer(10), Serialnum varchar(10), UplineSerial varchar(10), UplinePID integer(10), Downleft integer(10), LeftSerial varchar(10), Downright integer(10), RightSerial varchar(10), RowNum integer(10), ColumnPosi integer(10), ColumnTotal integer(10), DownlineAmount integer(10), Initial varchar(10), ActivateTime datetime, Status varchar(10), UserID varchar(10), ExpiredDate datetime, CreateDate datetime, Golden varchar(10), Primary Key (PID) )"; mysql_query($sql); table Quote Link to comment https://forums.phpfreaks.com/topic/78754-how-to-deal-with-large-database/#findComment-398572 Share on other sites More sharing options...
subcool Posted November 26, 2007 Share Posted November 26, 2007 Index values that you are searching for a lot... i search tables that have 700.000 records in a matter of seconds. Quote Link to comment https://forums.phpfreaks.com/topic/78754-how-to-deal-with-large-database/#findComment-399326 Share on other sites More sharing options...
fenway Posted November 26, 2007 Share Posted November 26, 2007 Why would you search the whole table to match a single record? Use a WHERE clause. Quote Link to comment https://forums.phpfreaks.com/topic/78754-how-to-deal-with-large-database/#findComment-399373 Share on other sites More sharing options...
zgkhoo Posted November 27, 2007 Author Share Posted November 27, 2007 Index values that you are searching for a lot... i search tables that have 700.000 records in a matter of seconds. PID integer(10), <---i already create an index ....u meant this? or need use others indexing method? Quote Link to comment https://forums.phpfreaks.com/topic/78754-how-to-deal-with-large-database/#findComment-400050 Share on other sites More sharing options...
zgkhoo Posted November 27, 2007 Author Share Posted November 27, 2007 Why would you search the whole table to match a single record? Use a WHERE clause. after using the where clause ..the query's record still large.. :-\ thanks Quote Link to comment https://forums.phpfreaks.com/topic/78754-how-to-deal-with-large-database/#findComment-400051 Share on other sites More sharing options...
fenway Posted November 27, 2007 Share Posted November 27, 2007 I don't see a where clause... and indexing on the UID won't help if you're not searching by uid. Quote Link to comment https://forums.phpfreaks.com/topic/78754-how-to-deal-with-large-database/#findComment-400356 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.