In order to avoid leaving queries opened, but still have a static result set, the views now create temporary tables with the results they use, fetch results from there, and close the query after fetching each page.
Approved by Tiago Salem Herrmann, PS Jenkins bot.