| 
	
 | 
 Posted by Julie on 11/25/05 15:45 
That limit is great.  I guess I can do the select query with the limit  
command, this way that query will not be so huge at once. 
Maybe jump about 5000 each time. 
I am just reading and exporting the data to a text file. 
 
Thanks so much for your help. 
 
 
"J.O. Aho" <user@example.net> wrote in message  
news:3uo2c0F121tifU1@individual.net... 
> Julie wrote: 
>> Thanks for your great response. 
>> That makes sense.  I tried to put some output in the loop that goes  
>> through 
>> each record, but it seems that the delay is before that, perhaps here: 
>> // delay is with this command 
>> $theresults=mysql_query( $sql ) 
> 
> Yes, this takes time if you have a large amount of entries that you need  
> to 
> load, you should try to limit things as much as possible, so you get as  
> few 
> results as possible, as a high amount results consumes time and memory and 
> http transports has a default timeout time of 180s and in php.ini there is 
> setting for how long a php script can run, how long time it's allowed to 
> collect data and how much memory it's allowed to use. 
> 
> ; Maximum execution time of each script, in seconds 
> max_execution_time = 30 
> 
> ; Maximum amount of time each script may spend parsing request data 
> max_input_time = 60 
> 
> ; Maximum amount of memory a script may consume (8MB) 
> memory_limit = 8M 
> 
> 
>> //then it is ok here and processes loop quickly 
>> while( $row = mysql_fetch_object( $theresults ) ) 
> 
> At this point you have got all the data. 
> 
> 
>> I think it is because it is loading in over 80000 records from mysql 
>> database in this query? 
>> Is there a command  or other method I can use that will not load the  
>> whole 
>> dataset at once, but only one record at a time?  Please assist 
> 
> As I don't know what you want to do, so it's difficult to give you a good 
> hint, but you can use LIMIT in your query and you get a limited amount of 
> rows, and you can use it to get row in the middle of the list. 
> 
> # Get max the 10 first lines 
> SELECT * FROM mytable LIMIT 10 
> 
> # Get the 10th to 20th line (first entry is number 0) 
> SELECT * FROM mytable LIMIT 9,10 
> 
> As you have su many rows in your database, you never want to see all of  
> them 
> at once, which makes that you should never do a 
> 
> SELECT * FROM mytable; 
> 
> and let the database do as much of the data manipulation and not load  
> values 
> to the php and modify something and then store it back. 
> 
> 
> //Aho
 
  
Navigation:
[Reply to this message] 
 |