Remove some full-table scans for authorization checks
Detailed description
It turns out that Pony's "lazy loading" of query results will immediately realize the entire query into a list at the drop of a hat, and you really need to use LIMIT and OFFSET to prevent that from happening.
Because of how authorization filtering works in Publ, count-based paginations were not using LIMIT and OFFSET. Now they are, and this has sped up rendering the global Atom feed on beesbuzz.biz by a significant factor.
Many huge thanks to @BearPerson / @AlsoBearPerson for helping me to figure out what was going on here, and being way more tenacious about digging through Pony than I am.
Test plan
Ensured that the paging and auth/paging test suites still behave correctly.
Summary
Remove some full-table scans for authorization checks
Detailed description
It turns out that Pony's "lazy loading" of query results will immediately realize the entire query into a list at the drop of a hat, and you really need to use LIMIT and OFFSET to prevent that from happening.
Because of how authorization filtering works in Publ, count-based paginations were not using LIMIT and OFFSET. Now they are, and this has sped up rendering the global Atom feed on beesbuzz.biz by a significant factor.
Many huge thanks to @BearPerson / @AlsoBearPerson for helping me to figure out what was going on here, and being way more tenacious about digging through Pony than I am.
Test plan
Ensured that the paging and auth/paging test suites still behave correctly.
Got a site to show off?