Welcome Guest, Not a member yet? Register   Sign In
Can CI's database class do this? (Memory Issues w/large data sets)
#1

[eluser]Unknown[/eluser]
I am having a memory problem because the result from the database being returned is anywhere from 5k too 100k records(and about 20 varchar255 columns +). I need to loop through each record and do a bunch of stuff but anyway the memory hit is about 25MB on only a 7,500 record return. I finally found a way to do this but I had to stop using CI's database class and use mysql function directly which I do not want to do. Why this works is because it is only taking up memory 1 record at a time and replacing that memory on the next loop, CI's database class seems to create an array looping through ALL records and then you loop through CI's array/obj. Can I use CI'S database class to only loop through 1 record at a time like below so I don't have memory problems? Basically I need CI to not create an array of all the results initially.

while ($row = mysql_fetch_assoc($result))

Thanks for the help, if you need more info let me know.

-Danny


Messages In This Thread
Can CI's database class do this? (Memory Issues w/large data sets) - by El Forum - 12-11-2008, 02:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB