"In my case, I need to pull all the records (60,000) from the database to compute some aggregation which I cannot compute using sql"
Are you familiar with window functions in SQL? I've never met an aggregation need that couldn't be met with clever use of windows...