Re: An extremely large hash lookup mechanism [message #172246 is a reply to message #172232] |
Tue, 08 February 2011 00:28 |
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.
|
|
|