Hey,

when having large result sets the php code is run for every result which creates a performance problem for me. Is it possible to run the code just for the rendered results?

cheers Volkan

Comments

muschpusch’s picture

Status: Active » Needs review
StatusFileSize
new1.68 KB

I had a quick look at the code and the problem seems to be that the php code is executed in hook_views_post_execute. At that moment current_page and items_per_page aren't populated and php is executed for every result. I added items_per_page and current_page and skip the php execution for all records which won't be shown to the user. I have no idea how this will affect views_php sorting because i didn't looked at the code for it. So please review wisely. It works nicely with exposed filters btw.

geerlingguy’s picture

This would most likely mess with a Views PHP sort filter, because that filter would require every row to be loaded in order to work correctly. Note that I haven't tested it, but it seems like that would be the case...

liam morland’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Issue summary: View changes