Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Design issue

by DentArthurDent (Monk)
on Sep 25, 2003 at 13:13 UTC ( [id://294151]=note: print w/replies, xml ) Need Help??


in reply to Force perl to release memory back to the operating system

I think your problem is one of design. Rather than trying to save all the records and sorting them, just iterate through all of them saving only the ones with the thirty highest balances if all you want to do is find the top clients.

Replies are listed 'Best First'.
Re: Design issue
by paulbort (Hermit) on Sep 25, 2003 at 18:24 UTC
    You missed part of the point: The data sought is the top thirty customers by total, where each customer has multiple transactions. There's no way to know that the last transaction in the file, plus something you've already discarded as inadequate, isn't enough to put a customer back in the top 30.

    The previous suggestions of sorting address this neatly. I was hoping to have something clever to add, but as usual the more prompt monks have covered this one thoroughly.

    --
    Spring: Forces, Coiled Again!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://294151]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-19 10:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found