FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » An extremely large hash lookup mechanism
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: An extremely large hash lookup mechanism [message #172246 is a reply to message #172232] Tue, 08 February 2011 00:28 Go to previous message
Jo Schulze is currently offline  Jo Schulze
Messages: 15
Registered: January 2011
Karma:
Junior Member
ram wrote:

> Now I modified the script to read all customer_unique_key ->
> customerid as key value pairs into an array
> This works fine and fast , but hogs the memory and crashes whenever
> the number of records crosses around 3-4 million.

The penalty of PHP arrays is that they eat up memory way more than Perl
arrays do. This isn't a problem as long as you build up structures in
the size of hundred thousands or in your case millions.

Basic answer: don't do it. As suggested, don't fetch the result with
million of hits but process them one-by-one.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: String Replacement
Next Topic: mail function and wordwrap
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 09:50:36 GMT 2024

Total time taken to generate the page: 0.04248 seconds