this is for a ranking that shows the user rank on the ranking of the users based on the count of user she/he invited to site . this now returns 500 on server which is because of memory limit which i dont want it to consume that amount of memory . how can i rewrite this with chunk so it consume less memory ??
256mb on server and i have been told that it cant be increased a lot due to high load on server and the query is being lunched on like 50k users . is that amount really alot for that ram ???
So you can use chunk but propably if you need create array of that count users, you will need change server where they allow you to increase memory limit higher than 256MB.